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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
212,500 | moodle/moodle | lib/webdavlib.php | webdav_client.copy_file | function copy_file($src_path, $dst_path, $overwrite) {
$this->_path = $this->translate_uri($src_path);
$this->header_unset();
$this->create_basic_request('COPY');
$this->header_add(sprintf('Destination: http://%s%s', $this->_server, $this->translate_uri($dst_path)));
if ($overwri... | php | function copy_file($src_path, $dst_path, $overwrite) {
$this->_path = $this->translate_uri($src_path);
$this->header_unset();
$this->create_basic_request('COPY');
$this->header_add(sprintf('Destination: http://%s%s', $this->_server, $this->translate_uri($dst_path)));
if ($overwri... | [
"function",
"copy_file",
"(",
"$",
"src_path",
",",
"$",
"dst_path",
",",
"$",
"overwrite",
")",
"{",
"$",
"this",
"->",
"_path",
"=",
"$",
"this",
"->",
"translate_uri",
"(",
"$",
"src_path",
")",
";",
"$",
"this",
"->",
"header_unset",
"(",
")",
";... | Public method copy_file
Copies a file on a webdav server
Duplicates a file on the webdav server (serverside).
All work is done on the webdav server. If you set param overwrite as true,
the target will be overwritten.
@param string src_path, string dest_path, bool overwrite
@return int status code (look at rfc 2518).... | [
"Public",
"method",
"copy_file"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L447-L481 |
212,501 | moodle/moodle | lib/webdavlib.php | webdav_client.copy_coll | function copy_coll($src_path, $dst_path, $overwrite) {
$this->_path = $this->translate_uri($src_path);
$this->header_unset();
$this->create_basic_request('COPY');
$this->header_add(sprintf('Destination: http://%s%s', $this->_server, $this->translate_uri($dst_path)));
$this->heade... | php | function copy_coll($src_path, $dst_path, $overwrite) {
$this->_path = $this->translate_uri($src_path);
$this->header_unset();
$this->create_basic_request('COPY');
$this->header_add(sprintf('Destination: http://%s%s', $this->_server, $this->translate_uri($dst_path)));
$this->heade... | [
"function",
"copy_coll",
"(",
"$",
"src_path",
",",
"$",
"dst_path",
",",
"$",
"overwrite",
")",
"{",
"$",
"this",
"->",
"_path",
"=",
"$",
"this",
"->",
"translate_uri",
"(",
"$",
"src_path",
")",
";",
"$",
"this",
"->",
"header_unset",
"(",
")",
";... | Public method copy_coll
Copies a collection on a webdav server
Duplicates a collection on the webdav server (serverside).
All work is done on the webdav server. If you set param overwrite as true,
the target will be overwritten.
@param string src_path, string dest_path, bool overwrite
@return int status code (look a... | [
"Public",
"method",
"copy_coll"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L495-L534 |
212,502 | moodle/moodle | lib/webdavlib.php | webdav_client.lock | function lock($path) {
$this->_path = $this->translate_uri($path);
$this->header_unset();
$this->create_basic_request('LOCK');
$this->header_add('Timeout: Infinite');
$this->header_add('Content-type: text/xml');
// create the xml request ...
$xml = "<?xml version... | php | function lock($path) {
$this->_path = $this->translate_uri($path);
$this->header_unset();
$this->create_basic_request('LOCK');
$this->header_add('Timeout: Infinite');
$this->header_add('Content-type: text/xml');
// create the xml request ...
$xml = "<?xml version... | [
"function",
"lock",
"(",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"_path",
"=",
"$",
"this",
"->",
"translate_uri",
"(",
"$",
"path",
")",
";",
"$",
"this",
"->",
"header_unset",
"(",
")",
";",
"$",
"this",
"->",
"create_basic_request",
"(",
"'LOCK'... | Public method lock
Locks a file or collection.
Lock uses this->_user as lock owner.
@param string path
@return int status code (look at rfc 2518). false on error. | [
"Public",
"method",
"lock"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L604-L679 |
212,503 | moodle/moodle | lib/webdavlib.php | webdav_client.unlock | function unlock($path, $locktoken) {
$this->_path = $this->translate_uri($path);
$this->header_unset();
$this->create_basic_request('UNLOCK');
$this->header_add(sprintf('Lock-Token: <%s>', $locktoken));
$this->send_request();
$this->get_respond();
$response = $thi... | php | function unlock($path, $locktoken) {
$this->_path = $this->translate_uri($path);
$this->header_unset();
$this->create_basic_request('UNLOCK');
$this->header_add(sprintf('Lock-Token: <%s>', $locktoken));
$this->send_request();
$this->get_respond();
$response = $thi... | [
"function",
"unlock",
"(",
"$",
"path",
",",
"$",
"locktoken",
")",
"{",
"$",
"this",
"->",
"_path",
"=",
"$",
"this",
"->",
"translate_uri",
"(",
"$",
"path",
")",
";",
"$",
"this",
"->",
"header_unset",
"(",
")",
";",
"$",
"this",
"->",
"create_b... | Public method unlock
Unlocks a file or collection.
@param string path, string locktoken
@return int status code (look at rfc 2518). false on error. | [
"Public",
"method",
"unlock"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L690-L707 |
212,504 | moodle/moodle | lib/webdavlib.php | webdav_client.delete | function delete($path) {
$this->_path = $this->translate_uri($path);
$this->header_unset();
$this->create_basic_request('DELETE');
/* $this->header_add('Content-Length: 0'); */
$this->header_add('');
$this->send_request();
$this->get_respond();
$response =... | php | function delete($path) {
$this->_path = $this->translate_uri($path);
$this->header_unset();
$this->create_basic_request('DELETE');
/* $this->header_add('Content-Length: 0'); */
$this->header_add('');
$this->send_request();
$this->get_respond();
$response =... | [
"function",
"delete",
"(",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"_path",
"=",
"$",
"this",
"->",
"translate_uri",
"(",
"$",
"path",
")",
";",
"$",
"this",
"->",
"header_unset",
"(",
")",
";",
"$",
"this",
"->",
"create_basic_request",
"(",
"'DEL... | Public method delete
deletes a collection/directory on a webdav server
@param string path
@return int status code (look at rfc 2518). false on error. | [
"Public",
"method",
"delete"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L716-L778 |
212,505 | moodle/moodle | lib/webdavlib.php | webdav_client.ls | function ls($path) {
if (trim($path) == '') {
$this->_error_log('Missing a path in method ls');
return false;
}
$this->_path = $this->translate_uri($path);
$this->header_unset();
$this->create_basic_request('PROPFIND');
$this->header_add('Depth: ... | php | function ls($path) {
if (trim($path) == '') {
$this->_error_log('Missing a path in method ls');
return false;
}
$this->_path = $this->translate_uri($path);
$this->header_unset();
$this->create_basic_request('PROPFIND');
$this->header_add('Depth: ... | [
"function",
"ls",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"trim",
"(",
"$",
"path",
")",
"==",
"''",
")",
"{",
"$",
"this",
"->",
"_error_log",
"(",
"'Missing a path in method ls'",
")",
";",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"_path",
... | Public method ls
Get's directory information from webdav server into flat a array using PROPFIND
All filenames are UTF-8 encoded.
Have a look at _propfind_startElement what keys are used in array returned.
@param string path
@return array dirinfo, false on error | [
"Public",
"method",
"ls"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L790-L868 |
212,506 | moodle/moodle | lib/webdavlib.php | webdav_client.gpi | function gpi($path) {
// split path by last "/"
$path = rtrim($path, "/");
$item = basename($path);
$dir = dirname($path);
$list = $this->ls($dir);
// be sure it is an array
if (is_array($list)) {
foreach($list as $e) {
$fullpath =... | php | function gpi($path) {
// split path by last "/"
$path = rtrim($path, "/");
$item = basename($path);
$dir = dirname($path);
$list = $this->ls($dir);
// be sure it is an array
if (is_array($list)) {
foreach($list as $e) {
$fullpath =... | [
"function",
"gpi",
"(",
"$",
"path",
")",
"{",
"// split path by last \"/\"",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"path",
",",
"\"/\"",
")",
";",
"$",
"item",
"=",
"basename",
"(",
"$",
"path",
")",
";",
"$",
"dir",
"=",
"dirname",
"(",
"$",
"path... | Public method gpi
Get's path information from webdav server for one element.
@param string path
@return array dirinfo. false on error | [
"Public",
"method",
"gpi"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L879-L901 |
212,507 | moodle/moodle | lib/webdavlib.php | webdav_client.is_file | function is_file($path) {
$item = $this->gpi($path);
if ($item === false) {
return false;
} else {
return ($item['resourcetype'] != 'collection');
}
} | php | function is_file($path) {
$item = $this->gpi($path);
if ($item === false) {
return false;
} else {
return ($item['resourcetype'] != 'collection');
}
} | [
"function",
"is_file",
"(",
"$",
"path",
")",
"{",
"$",
"item",
"=",
"$",
"this",
"->",
"gpi",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"item",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"return",
"(",
"$",
"item",
... | Public method is_file
Gathers whether a path points to a file or not.
@param string path
@return bool true or false | [
"Public",
"method",
"is_file"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L911-L920 |
212,508 | moodle/moodle | lib/webdavlib.php | webdav_client.is_dir | function is_dir($path) {
// be sure path is utf-8
$item = $this->gpi($path);
if ($item === false) {
return false;
} else {
return ($item['resourcetype'] == 'collection');
}
} | php | function is_dir($path) {
// be sure path is utf-8
$item = $this->gpi($path);
if ($item === false) {
return false;
} else {
return ($item['resourcetype'] == 'collection');
}
} | [
"function",
"is_dir",
"(",
"$",
"path",
")",
"{",
"// be sure path is utf-8",
"$",
"item",
"=",
"$",
"this",
"->",
"gpi",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"item",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"retur... | Public method is_dir
Gather whether a path points to a directory
@param string path
return bool true or false | [
"Public",
"method",
"is_dir"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L929-L939 |
212,509 | moodle/moodle | lib/webdavlib.php | webdav_client.mput | function mput($filelist) {
$result = true;
foreach ($filelist as $localpath => $destpath) {
$localpath = rtrim($localpath, "/");
$destpath = rtrim($destpath, "/");
// attempt to create target path
if (is_dir($localpath)) {
$pathparts =... | php | function mput($filelist) {
$result = true;
foreach ($filelist as $localpath => $destpath) {
$localpath = rtrim($localpath, "/");
$destpath = rtrim($destpath, "/");
// attempt to create target path
if (is_dir($localpath)) {
$pathparts =... | [
"function",
"mput",
"(",
"$",
"filelist",
")",
"{",
"$",
"result",
"=",
"true",
";",
"foreach",
"(",
"$",
"filelist",
"as",
"$",
"localpath",
"=>",
"$",
"destpath",
")",
"{",
"$",
"localpath",
"=",
"rtrim",
"(",
"$",
"localpath",
",",
"\"/\"",
")",
... | Public method mput
Puts multiple files and/or directories onto a webdav server.
Filenames should be allready UTF-8 encoded.
Param fileList must be in format array("localpath" => "destpath").
@param array filelist
@return bool true on success. otherwise int status code on error | [
"Public",
"method",
"mput"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L953-L997 |
212,510 | moodle/moodle | lib/webdavlib.php | webdav_client.mget | function mget($filelist) {
$result = true;
foreach ($filelist as $remotepath => $localpath) {
$localpath = rtrim($localpath, "/");
$remotepath = rtrim($remotepath, "/");
// attempt to create local path
if ($this->is_dir($remotepath)) {
... | php | function mget($filelist) {
$result = true;
foreach ($filelist as $remotepath => $localpath) {
$localpath = rtrim($localpath, "/");
$remotepath = rtrim($remotepath, "/");
// attempt to create local path
if ($this->is_dir($remotepath)) {
... | [
"function",
"mget",
"(",
"$",
"filelist",
")",
"{",
"$",
"result",
"=",
"true",
";",
"foreach",
"(",
"$",
"filelist",
"as",
"$",
"remotepath",
"=>",
"$",
"localpath",
")",
"{",
"$",
"localpath",
"=",
"rtrim",
"(",
"$",
"localpath",
",",
"\"/\"",
")",... | Public method mget
Gets multiple files and directories.
FileList must be in format array("remotepath" => "localpath").
Filenames are UTF-8 encoded.
@param array filelist
@return bool true on succes, other int status code on error | [
"Public",
"method",
"mget"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1010-L1054 |
212,511 | moodle/moodle | lib/webdavlib.php | webdav_client._endElement | private function _endElement($parser, $name) {
// end tag was found...
$parserid = (int) $parser;
$this->_xmltree[$parserid] = substr($this->_xmltree[$parserid],0, strlen($this->_xmltree[$parserid]) - (strlen($name) + 1));
} | php | private function _endElement($parser, $name) {
// end tag was found...
$parserid = (int) $parser;
$this->_xmltree[$parserid] = substr($this->_xmltree[$parserid],0, strlen($this->_xmltree[$parserid]) - (strlen($name) + 1));
} | [
"private",
"function",
"_endElement",
"(",
"$",
"parser",
",",
"$",
"name",
")",
"{",
"// end tag was found...",
"$",
"parserid",
"=",
"(",
"int",
")",
"$",
"parser",
";",
"$",
"this",
"->",
"_xmltree",
"[",
"$",
"parserid",
"]",
"=",
"substr",
"(",
"$... | Private method _endelement
a generic endElement method (used for all xml callbacks).
@param resource parser, string name
@access private | [
"Private",
"method",
"_endelement"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1070-L1074 |
212,512 | moodle/moodle | lib/webdavlib.php | webdav_client._propfind_startElement | private function _propfind_startElement($parser, $name, $attrs) {
// lower XML Names... maybe break a RFC, don't know ...
$parserid = (int) $parser;
$propname = strtolower($name);
if (!empty($this->_xmltree[$parserid])) {
$this->_xmltree[$parserid] .= $propname . '_';
... | php | private function _propfind_startElement($parser, $name, $attrs) {
// lower XML Names... maybe break a RFC, don't know ...
$parserid = (int) $parser;
$propname = strtolower($name);
if (!empty($this->_xmltree[$parserid])) {
$this->_xmltree[$parserid] .= $propname . '_';
... | [
"private",
"function",
"_propfind_startElement",
"(",
"$",
"parser",
",",
"$",
"name",
",",
"$",
"attrs",
")",
"{",
"// lower XML Names... maybe break a RFC, don't know ...",
"$",
"parserid",
"=",
"(",
"int",
")",
"$",
"parser",
";",
"$",
"propname",
"=",
"strto... | Private method _propfind_startElement
Is needed by public method ls.
Generic method will called by php xml_parse when a xml start element tag has been detected.
The xml tree will translated into a flat php array for easier access.
@param resource parser, string name, string attrs
@access private | [
"Private",
"method",
"_propfind_startElement"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1086-L1151 |
212,513 | moodle/moodle | lib/webdavlib.php | webdav_client._delete_startElement | private function _delete_startElement($parser, $name, $attrs) {
// lower XML Names... maybe break a RFC, don't know ...
$parserid = (int) $parser;
$propname = strtolower($name);
$this->_xmltree[$parserid] .= $propname . '_';
// translate xml tree to a flat array ...
swit... | php | private function _delete_startElement($parser, $name, $attrs) {
// lower XML Names... maybe break a RFC, don't know ...
$parserid = (int) $parser;
$propname = strtolower($name);
$this->_xmltree[$parserid] .= $propname . '_';
// translate xml tree to a flat array ...
swit... | [
"private",
"function",
"_delete_startElement",
"(",
"$",
"parser",
",",
"$",
"name",
",",
"$",
"attrs",
")",
"{",
"// lower XML Names... maybe break a RFC, don't know ...",
"$",
"parserid",
"=",
"(",
"int",
")",
"$",
"parser",
";",
"$",
"propname",
"=",
"strtolo... | Private method _delete_startElement
Is used by public method delete.
Will be called by php xml_parse.
@param resource parser, string name, string attrs)
@access private | [
"Private",
"method",
"_delete_startElement"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1182-L1202 |
212,514 | moodle/moodle | lib/webdavlib.php | webdav_client._lock_startElement | private function _lock_startElement($parser, $name, $attrs) {
// lower XML Names... maybe break a RFC, don't know ...
$parserid = (int) $parser;
$propname = strtolower($name);
$this->_xmltree[$parserid] .= $propname . '_';
// translate xml tree to a flat array ...
/*
... | php | private function _lock_startElement($parser, $name, $attrs) {
// lower XML Names... maybe break a RFC, don't know ...
$parserid = (int) $parser;
$propname = strtolower($name);
$this->_xmltree[$parserid] .= $propname . '_';
// translate xml tree to a flat array ...
/*
... | [
"private",
"function",
"_lock_startElement",
"(",
"$",
"parser",
",",
"$",
"name",
",",
"$",
"attrs",
")",
"{",
"// lower XML Names... maybe break a RFC, don't know ...",
"$",
"parserid",
"=",
"(",
"int",
")",
"$",
"parser",
";",
"$",
"propname",
"=",
"strtolowe... | Private method _lock_startElement
Is needed by public method lock.
Mmethod will called by php xml_parse when a xml start element tag has been detected.
The xml tree will translated into a flat php array for easier access.
@param resource parser, string name, string attrs
@access private | [
"Private",
"method",
"_lock_startElement"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1234-L1279 |
212,515 | moodle/moodle | lib/webdavlib.php | webdav_client._lock_cData | private function _lock_cData($parser, $cdata) {
$parserid = (int) $parser;
if (trim($cdata) <> '') {
// $this->_error_log(($this->_xmltree[$parserid]) . '='. htmlentities($cdata));
$this->_lock_ref_cdata .= $cdata;
} else {
// do nothing
}
} | php | private function _lock_cData($parser, $cdata) {
$parserid = (int) $parser;
if (trim($cdata) <> '') {
// $this->_error_log(($this->_xmltree[$parserid]) . '='. htmlentities($cdata));
$this->_lock_ref_cdata .= $cdata;
} else {
// do nothing
}
} | [
"private",
"function",
"_lock_cData",
"(",
"$",
"parser",
",",
"$",
"cdata",
")",
"{",
"$",
"parserid",
"=",
"(",
"int",
")",
"$",
"parser",
";",
"if",
"(",
"trim",
"(",
"$",
"cdata",
")",
"<>",
"''",
")",
"{",
"// $this->_error_log(($this->_xmltree[$par... | Private method _lock_cData
Is used by public method lock.
Will be called by php xml_set_character_data_handler() when xml data has to be handled.
Stores data found into class var _lock_ref_cdata
@param resource parser, string cdata
@access private | [
"Private",
"method",
"_lock_cData"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1291-L1299 |
212,516 | moodle/moodle | lib/webdavlib.php | webdav_client.create_basic_request | private function create_basic_request($method) {
$this->header_add(sprintf('%s %s %s', $method, $this->_path, $this->_protocol));
$this->header_add(sprintf('Host: %s:%s', $this->_server, $this->_port));
//$request .= sprintf('Connection: Keep-Alive');
$this->header_add(sprintf('User-Agen... | php | private function create_basic_request($method) {
$this->header_add(sprintf('%s %s %s', $method, $this->_path, $this->_protocol));
$this->header_add(sprintf('Host: %s:%s', $this->_server, $this->_port));
//$request .= sprintf('Connection: Keep-Alive');
$this->header_add(sprintf('User-Agen... | [
"private",
"function",
"create_basic_request",
"(",
"$",
"method",
")",
"{",
"$",
"this",
"->",
"header_add",
"(",
"sprintf",
"(",
"'%s %s %s'",
",",
"$",
"method",
",",
"$",
"this",
"->",
"_path",
",",
"$",
"this",
"->",
"_protocol",
")",
")",
";",
"$... | Private method create_basic_request
creates by using private method header_add an general request header.
@param string method
@access private | [
"Private",
"method",
"create_basic_request"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1331-L1347 |
212,517 | moodle/moodle | lib/webdavlib.php | webdav_client.digest_auth | private function digest_auth() {
$headers = array();
$headers[] = sprintf('%s %s %s', 'HEAD', $this->_path, $this->_protocol);
$headers[] = sprintf('Host: %s:%s', $this->_server, $this->_port);
$headers[] = sprintf('User-Agent: %s', $this->_user_agent);
$headers = implode("\r\n"... | php | private function digest_auth() {
$headers = array();
$headers[] = sprintf('%s %s %s', 'HEAD', $this->_path, $this->_protocol);
$headers[] = sprintf('Host: %s:%s', $this->_server, $this->_port);
$headers[] = sprintf('User-Agent: %s', $this->_user_agent);
$headers = implode("\r\n"... | [
"private",
"function",
"digest_auth",
"(",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"$",
"headers",
"[",
"]",
"=",
"sprintf",
"(",
"'%s %s %s'",
",",
"'HEAD'",
",",
"$",
"this",
"->",
"_path",
",",
"$",
"this",
"->",
"_protocol",
")",
... | Reads the header, stores the challenge information
@return void | [
"Reads",
"the",
"header",
"stores",
"the",
"challenge",
"information"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1354-L1389 |
212,518 | moodle/moodle | lib/webdavlib.php | webdav_client.digest_signature | private function digest_signature($method) {
if (!$this->_digestchallenge) {
$this->digest_auth();
}
$signature = array();
$signature['username'] = '"' . $this->_user . '"';
$signature['realm'] = '"' . $this->_digestchallenge['realm'] . '"';
$signature['nonce... | php | private function digest_signature($method) {
if (!$this->_digestchallenge) {
$this->digest_auth();
}
$signature = array();
$signature['username'] = '"' . $this->_user . '"';
$signature['realm'] = '"' . $this->_digestchallenge['realm'] . '"';
$signature['nonce... | [
"private",
"function",
"digest_signature",
"(",
"$",
"method",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_digestchallenge",
")",
"{",
"$",
"this",
"->",
"digest_auth",
"(",
")",
";",
"}",
"$",
"signature",
"=",
"array",
"(",
")",
";",
"$",
"signa... | Generates the digest signature
@return string signature to add to the headers
@access private | [
"Generates",
"the",
"digest",
"signature"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1397-L1438 |
212,519 | moodle/moodle | lib/webdavlib.php | webdav_client.send_request | private function send_request() {
// check if stream is declared to be open
// only logical check we are not sure if socket is really still open ...
if ($this->_connection_closed) {
// reopen it
// be sure to close the open socket.
$this->close();
... | php | private function send_request() {
// check if stream is declared to be open
// only logical check we are not sure if socket is really still open ...
if ($this->_connection_closed) {
// reopen it
// be sure to close the open socket.
$this->close();
... | [
"private",
"function",
"send_request",
"(",
")",
"{",
"// check if stream is declared to be open",
"// only logical check we are not sure if socket is really still open ...",
"if",
"(",
"$",
"this",
"->",
"_connection_closed",
")",
"{",
"// reopen it",
"// be sure to close the open... | Private method send_request
Sends a ready formed http/webdav request to webdav server.
@access private | [
"Private",
"method",
"send_request"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1447-L1462 |
212,520 | moodle/moodle | lib/webdavlib.php | webdav_client.process_respond | private function process_respond() {
$lines = explode("\r\n", $this->_header);
$header_done = false;
// $this->_error_log($this->_buffer);
// First line should be a HTTP status line (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6)
// Format is: HTTP-Version SP Sta... | php | private function process_respond() {
$lines = explode("\r\n", $this->_header);
$header_done = false;
// $this->_error_log($this->_buffer);
// First line should be a HTTP status line (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6)
// Format is: HTTP-Version SP Sta... | [
"private",
"function",
"process_respond",
"(",
")",
"{",
"$",
"lines",
"=",
"explode",
"(",
"\"\\r\\n\"",
",",
"$",
"this",
"->",
"_header",
")",
";",
"$",
"header_done",
"=",
"false",
";",
"// $this->_error_log($this->_buffer);",
"// First line should be a HTTP sta... | Private method process_respond
Processes the webdav server respond and detects its components (header, body).
and returns data array structure.
@return array ret_struct
@access private | [
"Private",
"method",
"process_respond"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1645-L1685 |
212,521 | moodle/moodle | lib/webdavlib.php | webdav_client.translate_uri | private function translate_uri($uri) {
// remove all html entities...
$native_path = html_entity_decode($uri);
$parts = explode('/', $native_path);
for ($i = 0; $i < count($parts); $i++) {
// check if part is allready utf8
if (iconv('UTF-8', 'UTF-8', $parts[$i]) =... | php | private function translate_uri($uri) {
// remove all html entities...
$native_path = html_entity_decode($uri);
$parts = explode('/', $native_path);
for ($i = 0; $i < count($parts); $i++) {
// check if part is allready utf8
if (iconv('UTF-8', 'UTF-8', $parts[$i]) =... | [
"private",
"function",
"translate_uri",
"(",
"$",
"uri",
")",
"{",
"// remove all html entities...",
"$",
"native_path",
"=",
"html_entity_decode",
"(",
"$",
"uri",
")",
";",
"$",
"parts",
"=",
"explode",
"(",
"'/'",
",",
"$",
"native_path",
")",
";",
"for",... | Private method translate_uri
translates an uri to raw url encoded string.
Removes any html entity in uri
@param string uri
@return string translated_uri
@access private | [
"Private",
"method",
"translate_uri"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1711-L1724 |
212,522 | moodle/moodle | lib/webdavlib.php | webdav_client.utf_decode_path | private function utf_decode_path($path) {
$fullpath = $path;
if (iconv('UTF-8', 'UTF-8', $fullpath) == $fullpath) {
$this->_error_log("filename is utf-8. Needs conversion...");
$fullpath = utf8_decode($fullpath);
}
return $fullpath;
} | php | private function utf_decode_path($path) {
$fullpath = $path;
if (iconv('UTF-8', 'UTF-8', $fullpath) == $fullpath) {
$this->_error_log("filename is utf-8. Needs conversion...");
$fullpath = utf8_decode($fullpath);
}
return $fullpath;
} | [
"private",
"function",
"utf_decode_path",
"(",
"$",
"path",
")",
"{",
"$",
"fullpath",
"=",
"$",
"path",
";",
"if",
"(",
"iconv",
"(",
"'UTF-8'",
",",
"'UTF-8'",
",",
"$",
"fullpath",
")",
"==",
"$",
"fullpath",
")",
"{",
"$",
"this",
"->",
"_error_l... | Private method utf_decode_path
decodes a UTF-8 encoded string
@return string decodedstring
@access private | [
"Private",
"method",
"utf_decode_path"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/webdavlib.php#L1733-L1740 |
212,523 | moodle/moodle | lib/dml/sqlsrv_native_moodle_recordset.php | sqlsrv_native_moodle_recordset.transaction_starts | public function transaction_starts() {
if ($this->buffer !== null) {
$this->unregister();
return;
}
if (!$this->rsrc) {
$this->unregister();
return;
}
// This might eat memory pretty quickly...
raise_memory_limit('2G');
... | php | public function transaction_starts() {
if ($this->buffer !== null) {
$this->unregister();
return;
}
if (!$this->rsrc) {
$this->unregister();
return;
}
// This might eat memory pretty quickly...
raise_memory_limit('2G');
... | [
"public",
"function",
"transaction_starts",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"buffer",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"unregister",
"(",
")",
";",
"return",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"rsrc",
")",
"{",
"... | Inform existing open recordsets that transaction
is starting, this works around MARS problem described
in MDL-37734. | [
"Inform",
"existing",
"open",
"recordsets",
"that",
"transaction",
"is",
"starting",
"this",
"works",
"around",
"MARS",
"problem",
"described",
"in",
"MDL",
"-",
"37734",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/sqlsrv_native_moodle_recordset.php#L51-L67 |
212,524 | moodle/moodle | lib/dml/sqlsrv_native_moodle_recordset.php | sqlsrv_native_moodle_recordset.unregister | private function unregister() {
if ($this->db) {
$this->db->recordset_closed($this);
$this->db = null;
}
} | php | private function unregister() {
if ($this->db) {
$this->db->recordset_closed($this);
$this->db = null;
}
} | [
"private",
"function",
"unregister",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"db",
")",
"{",
"$",
"this",
"->",
"db",
"->",
"recordset_closed",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"db",
"=",
"null",
";",
"}",
"}"
] | Unregister recordset from the global list of open recordsets. | [
"Unregister",
"recordset",
"from",
"the",
"global",
"list",
"of",
"open",
"recordsets",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/sqlsrv_native_moodle_recordset.php#L72-L77 |
212,525 | moodle/moodle | mod/workshop/allocation/scheduled/classes/observer.php | observer.workshop_viewed | public static function workshop_viewed($event) {
global $DB, $CFG;
require_once($CFG->dirroot . '/mod/workshop/locallib.php');
$workshop = $event->get_record_snapshot('workshop', $event->objectid);
$course = $event->get_record_snapshot('course', $event->courseid);
$cm =... | php | public static function workshop_viewed($event) {
global $DB, $CFG;
require_once($CFG->dirroot . '/mod/workshop/locallib.php');
$workshop = $event->get_record_snapshot('workshop', $event->objectid);
$course = $event->get_record_snapshot('course', $event->courseid);
$cm =... | [
"public",
"static",
"function",
"workshop_viewed",
"(",
"$",
"event",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mod/workshop/locallib.php'",
")",
";",
"$",
"workshop",
"=",
"$",
"event",
... | Triggered when the '\mod_workshop\event\course_module_viewed' event is triggered.
This does the same job as {@link workshopallocation_scheduled_cron()} but for the
single workshop. The idea is that we do not need to wait for cron to execute.
Displaying the workshop main view.php can trigger the scheduled allocation, t... | [
"Triggered",
"when",
"the",
"\\",
"mod_workshop",
"\\",
"event",
"\\",
"course_module_viewed",
"event",
"is",
"triggered",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/allocation/scheduled/classes/observer.php#L47-L83 |
212,526 | moodle/moodle | mod/forum/classes/prune_form.php | mod_forum_prune_form.definition | public function definition() {
$mform = $this->_form;
$mform->addElement('text', 'name', get_string('discussionname', 'forum'), array('size' => '60', 'maxlength' => '255'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');
$mform->a... | php | public function definition() {
$mform = $this->_form;
$mform->addElement('text', 'name', get_string('discussionname', 'forum'), array('size' => '60', 'maxlength' => '255'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');
$mform->a... | [
"public",
"function",
"definition",
"(",
")",
"{",
"$",
"mform",
"=",
"$",
"this",
"->",
"_form",
";",
"$",
"mform",
"->",
"addElement",
"(",
"'text'",
",",
"'name'",
",",
"get_string",
"(",
"'discussionname'",
",",
"'forum'",
")",
",",
"array",
"(",
"... | Form constructor. | [
"Form",
"constructor",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/prune_form.php#L44-L60 |
212,527 | moodle/moodle | blocks/calendar_upcoming/block_calendar_upcoming.php | block_calendar_upcoming.get_upcoming_content | public static function get_upcoming_content($events, $linkhref = null, $showcourselink = false) {
debugging(
'get_upcoming_content() is deprecated. ' .
'Please see block_calendar_upcoming::get_content() for the correct API usage.',
DEBUG_DEVELOPER
);
... | php | public static function get_upcoming_content($events, $linkhref = null, $showcourselink = false) {
debugging(
'get_upcoming_content() is deprecated. ' .
'Please see block_calendar_upcoming::get_content() for the correct API usage.',
DEBUG_DEVELOPER
);
... | [
"public",
"static",
"function",
"get_upcoming_content",
"(",
"$",
"events",
",",
"$",
"linkhref",
"=",
"null",
",",
"$",
"showcourselink",
"=",
"false",
")",
"{",
"debugging",
"(",
"'get_upcoming_content() is deprecated. '",
".",
"'Please see block_calendar_upcoming::ge... | Get the upcoming event block content.
@param array $events list of events
@param \moodle_url|string $linkhref link to event referer
@param boolean $showcourselink whether links to courses should be shown
@return string|null $content html block content
@deprecated since 3.4 | [
"Get",
"the",
"upcoming",
"event",
"block",
"content",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/calendar_upcoming/block_calendar_upcoming.php#L82-L126 |
212,528 | moodle/moodle | lib/horde/framework/Horde/Mail/Rfc822/List.php | Horde_Mail_Rfc822_List.remove | public function remove($obs)
{
$old = $this->_filter;
$this->setIteratorFilter(self::HIDE_GROUPS | self::BASE_ELEMENTS);
foreach ($this->_normalize($obs) as $val) {
$remove = array();
foreach ($this as $key => $val2) {
if ($val2->match($val)) {
... | php | public function remove($obs)
{
$old = $this->_filter;
$this->setIteratorFilter(self::HIDE_GROUPS | self::BASE_ELEMENTS);
foreach ($this->_normalize($obs) as $val) {
$remove = array();
foreach ($this as $key => $val2) {
if ($val2->match($val)) {
... | [
"public",
"function",
"remove",
"(",
"$",
"obs",
")",
"{",
"$",
"old",
"=",
"$",
"this",
"->",
"_filter",
";",
"$",
"this",
"->",
"setIteratorFilter",
"(",
"self",
"::",
"HIDE_GROUPS",
"|",
"self",
"::",
"BASE_ELEMENTS",
")",
";",
"foreach",
"(",
"$",
... | Remove addresses from the container. This method ignores Group objects.
@param mixed $obs Addresses to remove. | [
"Remove",
"addresses",
"from",
"the",
"container",
".",
"This",
"method",
"ignores",
"Group",
"objects",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mail/Rfc822/List.php#L135-L155 |
212,529 | moodle/moodle | lib/horde/framework/Horde/Mail/Rfc822/List.php | Horde_Mail_Rfc822_List.unique | public function unique()
{
$exist = $remove = array();
$old = $this->_filter;
$this->setIteratorFilter(self::HIDE_GROUPS | self::BASE_ELEMENTS);
// For duplicates, we use the first address that contains personal
// information.
foreach ($this as $key => $val) {
... | php | public function unique()
{
$exist = $remove = array();
$old = $this->_filter;
$this->setIteratorFilter(self::HIDE_GROUPS | self::BASE_ELEMENTS);
// For duplicates, we use the first address that contains personal
// information.
foreach ($this as $key => $val) {
... | [
"public",
"function",
"unique",
"(",
")",
"{",
"$",
"exist",
"=",
"$",
"remove",
"=",
"array",
"(",
")",
";",
"$",
"old",
"=",
"$",
"this",
"->",
"_filter",
";",
"$",
"this",
"->",
"setIteratorFilter",
"(",
"self",
"::",
"HIDE_GROUPS",
"|",
"self",
... | Removes duplicate addresses from list. This method ignores Group
objects. | [
"Removes",
"duplicate",
"addresses",
"from",
"list",
".",
"This",
"method",
"ignores",
"Group",
"objects",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mail/Rfc822/List.php#L161-L191 |
212,530 | moodle/moodle | lib/horde/framework/Horde/Mail/Rfc822/List.php | Horde_Mail_Rfc822_List.groupCount | public function groupCount()
{
$ret = 0;
foreach ($this->_data as $val) {
if ($val instanceof Horde_Mail_Rfc822_Group) {
++$ret;
}
}
return $ret;
} | php | public function groupCount()
{
$ret = 0;
foreach ($this->_data as $val) {
if ($val instanceof Horde_Mail_Rfc822_Group) {
++$ret;
}
}
return $ret;
} | [
"public",
"function",
"groupCount",
"(",
")",
"{",
"$",
"ret",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"_data",
"as",
"$",
"val",
")",
"{",
"if",
"(",
"$",
"val",
"instanceof",
"Horde_Mail_Rfc822_Group",
")",
"{",
"++",
"$",
"ret",
";",
"... | Group count.
@return integer The number of groups in the list. | [
"Group",
"count",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mail/Rfc822/List.php#L198-L209 |
212,531 | moodle/moodle | lib/horde/framework/Horde/Mail/Rfc822/List.php | Horde_Mail_Rfc822_List.setIteratorFilter | public function setIteratorFilter($mask = 0, $filter = null)
{
$this->_filter = array();
if ($mask) {
$this->_filter['mask'] = $mask;
}
if (!is_null($filter)) {
$rfc822 = new Horde_Mail_Rfc822();
$this->_filter['filter'] = $rfc822->parseAddressLi... | php | public function setIteratorFilter($mask = 0, $filter = null)
{
$this->_filter = array();
if ($mask) {
$this->_filter['mask'] = $mask;
}
if (!is_null($filter)) {
$rfc822 = new Horde_Mail_Rfc822();
$this->_filter['filter'] = $rfc822->parseAddressLi... | [
"public",
"function",
"setIteratorFilter",
"(",
"$",
"mask",
"=",
"0",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_filter",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"mask",
")",
"{",
"$",
"this",
"->",
"_filter",
"[",
"'ma... | Set the Iterator filter.
@param integer $mask Filter masks.
@param mixed $filter An e-mail, or as list of e-mails, to filter by. | [
"Set",
"the",
"Iterator",
"filter",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mail/Rfc822/List.php#L217-L229 |
212,532 | moodle/moodle | lib/horde/framework/Horde/Mail/Rfc822/List.php | Horde_Mail_Rfc822_List.contains | public function contains($address)
{
$ob = new Horde_Mail_Rfc822_Address($address);
foreach ($this->raw_addresses as $val) {
if ($val->match($ob)) {
return true;
}
}
return false;
} | php | public function contains($address)
{
$ob = new Horde_Mail_Rfc822_Address($address);
foreach ($this->raw_addresses as $val) {
if ($val->match($ob)) {
return true;
}
}
return false;
} | [
"public",
"function",
"contains",
"(",
"$",
"address",
")",
"{",
"$",
"ob",
"=",
"new",
"Horde_Mail_Rfc822_Address",
"(",
"$",
"address",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"raw_addresses",
"as",
"$",
"val",
")",
"{",
"if",
"(",
"$",
"val",
... | Does this list contain the given e-mail address?
@param mixed $address An e-mail address.
@return boolean True if the e-mail address is contained in the list. | [
"Does",
"this",
"list",
"contain",
"the",
"given",
"e",
"-",
"mail",
"address?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mail/Rfc822/List.php#L267-L278 |
212,533 | moodle/moodle | lib/horde/framework/Horde/Mail/Rfc822/List.php | Horde_Mail_Rfc822_List._normalize | protected function _normalize($obs)
{
$add = array();
if (!($obs instanceof Horde_Mail_Rfc822_List) &&
!is_array($obs)) {
$obs = array($obs);
}
foreach ($obs as $val) {
if (is_string($val)) {
$rfc822 = new Horde_Mail_Rfc822();
... | php | protected function _normalize($obs)
{
$add = array();
if (!($obs instanceof Horde_Mail_Rfc822_List) &&
!is_array($obs)) {
$obs = array($obs);
}
foreach ($obs as $val) {
if (is_string($val)) {
$rfc822 = new Horde_Mail_Rfc822();
... | [
"protected",
"function",
"_normalize",
"(",
"$",
"obs",
")",
"{",
"$",
"add",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"(",
"$",
"obs",
"instanceof",
"Horde_Mail_Rfc822_List",
")",
"&&",
"!",
"is_array",
"(",
"$",
"obs",
")",
")",
"{",
"$",
"ob... | Normalize objects to add to list.
@param mixed $obs Address data to store in this object.
@return array Entries to add. | [
"Normalize",
"objects",
"to",
"add",
"to",
"list",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mail/Rfc822/List.php#L302-L328 |
212,534 | moodle/moodle | lib/phpexcel/PHPExcel/Calculation/LookupRef.php | PHPExcel_Calculation_LookupRef.LOOKUP | public static function LOOKUP($lookup_value, $lookup_vector, $result_vector = null)
{
$lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value);
if (!is_array($lookup_vector)) {
return PHPExcel_Calculation_Functions::NA();
}
$lookupRows = count($l... | php | public static function LOOKUP($lookup_value, $lookup_vector, $result_vector = null)
{
$lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value);
if (!is_array($lookup_vector)) {
return PHPExcel_Calculation_Functions::NA();
}
$lookupRows = count($l... | [
"public",
"static",
"function",
"LOOKUP",
"(",
"$",
"lookup_value",
",",
"$",
"lookup_vector",
",",
"$",
"result_vector",
"=",
"null",
")",
"{",
"$",
"lookup_value",
"=",
"PHPExcel_Calculation_Functions",
"::",
"flattenSingleValue",
"(",
"$",
"lookup_value",
")",
... | LOOKUP
The LOOKUP function searches for value either from a one-row or one-column range or from an array.
@param lookup_value The value that you want to match in lookup_array
@param lookup_vector The range of cells being searched
@param result_vector The column from which the matching value must be re... | [
"LOOKUP",
"The",
"LOOKUP",
"function",
"searches",
"for",
"value",
"either",
"from",
"a",
"one",
"-",
"row",
"or",
"one",
"-",
"column",
"range",
"or",
"from",
"an",
"array",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Calculation/LookupRef.php#L819-L877 |
212,535 | moodle/moodle | grade/lib.php | graded_users_iterator.next_user | public function next_user() {
if (!$this->users_rs) {
return false; // no users present
}
if (!$this->users_rs->valid()) {
if ($current = $this->_pop()) {
// this is not good - user or grades updated between the two reads above :-(
}
... | php | public function next_user() {
if (!$this->users_rs) {
return false; // no users present
}
if (!$this->users_rs->valid()) {
if ($current = $this->_pop()) {
// this is not good - user or grades updated between the two reads above :-(
}
... | [
"public",
"function",
"next_user",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"users_rs",
")",
"{",
"return",
"false",
";",
"// no users present",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"users_rs",
"->",
"valid",
"(",
")",
")",
"{",
"if",
"... | Returns information about the next user
@return mixed array of user info, all grades and feedback or null when no more users found | [
"Returns",
"information",
"about",
"the",
"next",
"user"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/lib.php#L255-L322 |
212,536 | moodle/moodle | grade/lib.php | graded_users_iterator.close | public function close() {
if ($this->users_rs) {
$this->users_rs->close();
$this->users_rs = null;
}
if ($this->grades_rs) {
$this->grades_rs->close();
$this->grades_rs = null;
}
$this->gradestack = array();
} | php | public function close() {
if ($this->users_rs) {
$this->users_rs->close();
$this->users_rs = null;
}
if ($this->grades_rs) {
$this->grades_rs->close();
$this->grades_rs = null;
}
$this->gradestack = array();
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"users_rs",
")",
"{",
"$",
"this",
"->",
"users_rs",
"->",
"close",
"(",
")",
";",
"$",
"this",
"->",
"users_rs",
"=",
"null",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"... | Close the iterator, do not forget to call this function | [
"Close",
"the",
"iterator",
"do",
"not",
"forget",
"to",
"call",
"this",
"function"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/lib.php#L327-L337 |
212,537 | moodle/moodle | grade/lib.php | graded_users_iterator.require_active_enrolment | public function require_active_enrolment($onlyactive = true) {
if (!empty($this->users_rs)) {
debugging('Calling require_active_enrolment() has no effect unless you call init() again', DEBUG_DEVELOPER);
}
$this->onlyactive = $onlyactive;
} | php | public function require_active_enrolment($onlyactive = true) {
if (!empty($this->users_rs)) {
debugging('Calling require_active_enrolment() has no effect unless you call init() again', DEBUG_DEVELOPER);
}
$this->onlyactive = $onlyactive;
} | [
"public",
"function",
"require_active_enrolment",
"(",
"$",
"onlyactive",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"users_rs",
")",
")",
"{",
"debugging",
"(",
"'Calling require_active_enrolment() has no effect unless you call init() aga... | Should all enrolled users be exported or just those with an active enrolment?
@param bool $onlyactive True to limit the export to users with an active enrolment | [
"Should",
"all",
"enrolled",
"users",
"be",
"exported",
"or",
"just",
"those",
"with",
"an",
"active",
"enrolment?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/lib.php#L344-L349 |
212,538 | moodle/moodle | grade/lib.php | graded_users_iterator.allow_user_custom_fields | public function allow_user_custom_fields($allow = true) {
if ($allow) {
$this->allowusercustomfields = true;
} else {
$this->allowusercustomfields = false;
}
} | php | public function allow_user_custom_fields($allow = true) {
if ($allow) {
$this->allowusercustomfields = true;
} else {
$this->allowusercustomfields = false;
}
} | [
"public",
"function",
"allow_user_custom_fields",
"(",
"$",
"allow",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"allow",
")",
"{",
"$",
"this",
"->",
"allowusercustomfields",
"=",
"true",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"allowusercustomfields",
"=",
... | Allow custom fields to be included
@param bool $allow Whether to allow custom fields or not
@return void | [
"Allow",
"custom",
"fields",
"to",
"be",
"included"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/lib.php#L357-L363 |
212,539 | moodle/moodle | grade/lib.php | graded_users_iterator._pop | private function _pop() {
global $DB;
if (empty($this->gradestack)) {
if (empty($this->grades_rs) || !$this->grades_rs->valid()) {
return null; // no grades present
}
$current = $this->grades_rs->current();
$this->grades_rs->next();
... | php | private function _pop() {
global $DB;
if (empty($this->gradestack)) {
if (empty($this->grades_rs) || !$this->grades_rs->valid()) {
return null; // no grades present
}
$current = $this->grades_rs->current();
$this->grades_rs->next();
... | [
"private",
"function",
"_pop",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"gradestack",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"grades_rs",
")",
"||",
"!",
"$",
"this",
"->",
"grades_r... | Remove a grade_grade instance from the grade stack
@return grade_grade current grade object | [
"Remove",
"a",
"grade_grade",
"instance",
"from",
"the",
"grade",
"stack"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/lib.php#L382-L397 |
212,540 | moodle/moodle | grade/lib.php | grade_plugin_return.get_options | public function get_options() {
if (empty($this->type)) {
return array();
}
$params = array();
if (!empty($this->plugin)) {
$params['plugin'] = $this->plugin;
}
if (!empty($this->courseid)) {
$params['id'] = $this->courseid;
... | php | public function get_options() {
if (empty($this->type)) {
return array();
}
$params = array();
if (!empty($this->plugin)) {
$params['plugin'] = $this->plugin;
}
if (!empty($this->courseid)) {
$params['id'] = $this->courseid;
... | [
"public",
"function",
"get_options",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"type",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"params",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",... | Returns return parameters as options array suitable for buttons.
@return array options | [
"Returns",
"return",
"parameters",
"as",
"options",
"array",
"suitable",
"for",
"buttons",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/lib.php#L1198-L1226 |
212,541 | moodle/moodle | grade/lib.php | grade_plugin_return.get_return_url | public function get_return_url($default, $extras=null) {
global $CFG;
if (empty($this->type) or empty($this->plugin)) {
return $default;
}
$url = $CFG->wwwroot.'/grade/'.$this->type.'/'.$this->plugin.'/index.php';
$glue = '?';
if (!empty($this->courseid)) {... | php | public function get_return_url($default, $extras=null) {
global $CFG;
if (empty($this->type) or empty($this->plugin)) {
return $default;
}
$url = $CFG->wwwroot.'/grade/'.$this->type.'/'.$this->plugin.'/index.php';
$glue = '?';
if (!empty($this->courseid)) {... | [
"public",
"function",
"get_return_url",
"(",
"$",
"default",
",",
"$",
"extras",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"type",
")",
"or",
"empty",
"(",
"$",
"this",
"->",
"plugin",
")",
")",
... | Returns return url
@param string $default default url when params not set
@param array $extras Extra URL parameters
@return string url | [
"Returns",
"return",
"url"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/lib.php#L1236-L1274 |
212,542 | moodle/moodle | grade/lib.php | grade_plugin_return.get_form_fields | public function get_form_fields() {
if (empty($this->type)) {
return '';
}
$result = '<input type="hidden" name="gpr_type" value="'.$this->type.'" />';
if (!empty($this->plugin)) {
$result .= '<input type="hidden" name="gpr_plugin" value="'.$this->plugin.'" />'... | php | public function get_form_fields() {
if (empty($this->type)) {
return '';
}
$result = '<input type="hidden" name="gpr_type" value="'.$this->type.'" />';
if (!empty($this->plugin)) {
$result .= '<input type="hidden" name="gpr_plugin" value="'.$this->plugin.'" />'... | [
"public",
"function",
"get_form_fields",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"type",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"result",
"=",
"'<input type=\"hidden\" name=\"gpr_type\" value=\"'",
".",
"$",
"this",
"->",
"type",
... | Returns string with hidden return tracking form elements.
@return string | [
"Returns",
"string",
"with",
"hidden",
"return",
"tracking",
"form",
"elements",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/lib.php#L1280-L1307 |
212,543 | moodle/moodle | grade/lib.php | grade_plugin_return.add_mform_elements | public function add_mform_elements(&$mform) {
if (empty($this->type)) {
return;
}
$mform->addElement('hidden', 'gpr_type', $this->type);
$mform->setType('gpr_type', PARAM_SAFEDIR);
if (!empty($this->plugin)) {
$mform->addElement('hidden', 'gpr_plugin', $... | php | public function add_mform_elements(&$mform) {
if (empty($this->type)) {
return;
}
$mform->addElement('hidden', 'gpr_type', $this->type);
$mform->setType('gpr_type', PARAM_SAFEDIR);
if (!empty($this->plugin)) {
$mform->addElement('hidden', 'gpr_plugin', $... | [
"public",
"function",
"add_mform_elements",
"(",
"&",
"$",
"mform",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"type",
")",
")",
"{",
"return",
";",
"}",
"$",
"mform",
"->",
"addElement",
"(",
"'hidden'",
",",
"'gpr_type'",
",",
"$",
"this... | Add hidden elements into mform
@param object &$mform moodle form object
@return void | [
"Add",
"hidden",
"elements",
"into",
"mform"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/lib.php#L1316-L1348 |
212,544 | moodle/moodle | grade/lib.php | grade_plugin_return.add_url_params | public function add_url_params(moodle_url $url) {
if (empty($this->type)) {
return $url;
}
$url->param('gpr_type', $this->type);
if (!empty($this->plugin)) {
$url->param('gpr_plugin', $this->plugin);
}
if (!empty($this->courseid)) {
... | php | public function add_url_params(moodle_url $url) {
if (empty($this->type)) {
return $url;
}
$url->param('gpr_type', $this->type);
if (!empty($this->plugin)) {
$url->param('gpr_plugin', $this->plugin);
}
if (!empty($this->courseid)) {
... | [
"public",
"function",
"add_url_params",
"(",
"moodle_url",
"$",
"url",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"type",
")",
")",
"{",
"return",
"$",
"url",
";",
"}",
"$",
"url",
"->",
"param",
"(",
"'gpr_type'",
",",
"$",
"this",
"->"... | Add return tracking params into url
@param moodle_url $url A URL
@return string $url with return tracking params | [
"Add",
"return",
"tracking",
"params",
"into",
"url"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/lib.php#L1357-L1385 |
212,545 | moodle/moodle | mod/lti/service/memberships/classes/local/service/memberships.php | memberships.get_users_json | public static function get_users_json($resource, $context, $contextid, $tool, $role, $limitfrom, $limitnum, $lti, $info) {
$withcapability = '';
$exclude = array();
if (!empty($role)) {
if ((strpos($role, 'http://') !== 0) && (strpos($role, 'https://') !== 0)) {
$rol... | php | public static function get_users_json($resource, $context, $contextid, $tool, $role, $limitfrom, $limitnum, $lti, $info) {
$withcapability = '';
$exclude = array();
if (!empty($role)) {
if ((strpos($role, 'http://') !== 0) && (strpos($role, 'https://') !== 0)) {
$rol... | [
"public",
"static",
"function",
"get_users_json",
"(",
"$",
"resource",
",",
"$",
"context",
",",
"$",
"contextid",
",",
"$",
"tool",
",",
"$",
"role",
",",
"$",
"limitfrom",
",",
"$",
"limitnum",
",",
"$",
"lti",
",",
"$",
"info",
")",
"{",
"$",
"... | Get the JSON for members.
@param \mod_lti\local\ltiservice\resource_base $resource Resource handling the request
@param \context_course $context Course context
@param string $contextid Course ID
@param object $tool Tool instance object
@param string $role User r... | [
"Get",
"the",
"JSON",
"for",
"members",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lti/service/memberships/classes/local/service/memberships.php#L105-L128 |
212,546 | moodle/moodle | mod/lti/service/memberships/classes/local/service/memberships.php | memberships.is_allowed_field_set | private static function is_allowed_field_set($toolconfig, $instanceconfig, $fields) {
$isallowedstate = [];
foreach ($fields as $key => $field) {
$allowed = self::ALWAYS_INCLUDE_FIELD == $toolconfig->{$field};
if (!$allowed) {
if (self::DELEGATE_TO_INSTRUCTOR == $... | php | private static function is_allowed_field_set($toolconfig, $instanceconfig, $fields) {
$isallowedstate = [];
foreach ($fields as $key => $field) {
$allowed = self::ALWAYS_INCLUDE_FIELD == $toolconfig->{$field};
if (!$allowed) {
if (self::DELEGATE_TO_INSTRUCTOR == $... | [
"private",
"static",
"function",
"is_allowed_field_set",
"(",
"$",
"toolconfig",
",",
"$",
"instanceconfig",
",",
"$",
"fields",
")",
"{",
"$",
"isallowedstate",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"key",
"=>",
"$",
"field",
")"... | Determines whether a user attribute may be used as part of LTI membership
@param object $toolconfig Tool config
@param object $instanceconfig Tool instance config
@param array $fields Set of fields to return if allowed or not
@return array Verification which associates a... | [
"Determines",
"whether",
"a",
"user",
"attribute",
"may",
"be",
"used",
"as",
"part",
"of",
"LTI",
"membership"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lti/service/memberships/classes/local/service/memberships.php#L267-L279 |
212,547 | moodle/moodle | lib/pear/HTML/QuickForm/Renderer/Default.php | HTML_QuickForm_Renderer_Default._prepareTemplate | function _prepareTemplate($name, $label, $required, $error)
{
if (is_array($label)) {
$nameLabel = array_shift($label);
} else {
$nameLabel = $label;
}
if (isset($this->_templates[$name])) {
$html = str_replace('{label}', $nameLabel, $this->_templa... | php | function _prepareTemplate($name, $label, $required, $error)
{
if (is_array($label)) {
$nameLabel = array_shift($label);
} else {
$nameLabel = $label;
}
if (isset($this->_templates[$name])) {
$html = str_replace('{label}', $nameLabel, $this->_templa... | [
"function",
"_prepareTemplate",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"required",
",",
"$",
"error",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"label",
")",
")",
"{",
"$",
"nameLabel",
"=",
"array_shift",
"(",
"$",
"label",
")",
";",
"}",... | Helper method for renderElement
@param string Element name
@param mixed Element label (if using an array of labels, you should set the appropriate template)
@param bool Whether an element is required
@param string Error message associated with the element
@access private
@see ... | [
"Helper",
"method",
"for",
"renderElement"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/Renderer/Default.php#L241-L278 |
212,548 | moodle/moodle | lib/pear/HTML/QuickForm/Renderer/Default.php | HTML_QuickForm_Renderer_Default.startGroup | function startGroup(&$group, $required, $error)
{
$name = $group->getName();
$this->_groupTemplate = $this->_prepareTemplate($name, $group->getLabel(), $required, $error);
$this->_groupElementTemplate = empty($this->_groupTemplates[$name])? '': $this->_groupTemplates[$name];
$... | php | function startGroup(&$group, $required, $error)
{
$name = $group->getName();
$this->_groupTemplate = $this->_prepareTemplate($name, $group->getLabel(), $required, $error);
$this->_groupElementTemplate = empty($this->_groupTemplates[$name])? '': $this->_groupTemplates[$name];
$... | [
"function",
"startGroup",
"(",
"&",
"$",
"group",
",",
"$",
"required",
",",
"$",
"error",
")",
"{",
"$",
"name",
"=",
"$",
"group",
"->",
"getName",
"(",
")",
";",
"$",
"this",
"->",
"_groupTemplate",
"=",
"$",
"this",
"->",
"_prepareTemplate",
"(",... | Called when visiting a group, before processing any group elements
@param object An HTML_QuickForm_group object being visited
@param bool Whether a group is required
@param string An error message associated with a group
@access public
@return void | [
"Called",
"when",
"visiting",
"a",
"group",
"before",
"processing",
"any",
"group",
"elements"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/Renderer/Default.php#L345-L353 |
212,549 | moodle/moodle | lib/pear/HTML/QuickForm/Renderer/Default.php | HTML_QuickForm_Renderer_Default.finishGroup | function finishGroup(&$group)
{
$separator = $group->_separator;
if (is_array($separator)) {
$count = count($separator);
$html = '';
for ($i = 0; $i < count($this->_groupElements); $i++) {
$html .= (0 == $i? '': $separator[($i - 1) % $count]) . $t... | php | function finishGroup(&$group)
{
$separator = $group->_separator;
if (is_array($separator)) {
$count = count($separator);
$html = '';
for ($i = 0; $i < count($this->_groupElements); $i++) {
$html .= (0 == $i? '': $separator[($i - 1) % $count]) . $t... | [
"function",
"finishGroup",
"(",
"&",
"$",
"group",
")",
"{",
"$",
"separator",
"=",
"$",
"group",
"->",
"_separator",
";",
"if",
"(",
"is_array",
"(",
"$",
"separator",
")",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"separator",
")",
";",
"$"... | Called when visiting a group, after processing all group elements
@param object An HTML_QuickForm_group object being visited
@access public
@return void | [
"Called",
"when",
"visiting",
"a",
"group",
"after",
"processing",
"all",
"group",
"elements"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/Renderer/Default.php#L362-L382 |
212,550 | moodle/moodle | lib/pear/HTML/QuickForm/Renderer/Default.php | HTML_QuickForm_Renderer_Default.setElementTemplate | function setElementTemplate($html, $element = null)
{
if (is_null($element)) {
$this->_elementTemplate = $html;
} else {
$this->_templates[$element] = $html;
}
} | php | function setElementTemplate($html, $element = null)
{
if (is_null($element)) {
$this->_elementTemplate = $html;
} else {
$this->_templates[$element] = $html;
}
} | [
"function",
"setElementTemplate",
"(",
"$",
"html",
",",
"$",
"element",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"element",
")",
")",
"{",
"$",
"this",
"->",
"_elementTemplate",
"=",
"$",
"html",
";",
"}",
"else",
"{",
"$",
"this",
"... | Sets element template
@param string The HTML surrounding an element
@param string (optional) Name of the element to apply template for
@access public
@return void | [
"Sets",
"element",
"template"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/Renderer/Default.php#L392-L399 |
212,551 | moodle/moodle | lib/minify/matthiasmullie-pathconverter/src/Converter.php | Converter.shared | protected function shared($path1, $path2)
{
// $path could theoretically be empty (e.g. no path is given), in which
// case it shouldn't expand to array(''), which would compare to one's
// root /
$path1 = $path1 ? explode('/', $path1) : array();
$path2 = $path2 ? explode('/'... | php | protected function shared($path1, $path2)
{
// $path could theoretically be empty (e.g. no path is given), in which
// case it shouldn't expand to array(''), which would compare to one's
// root /
$path1 = $path1 ? explode('/', $path1) : array();
$path2 = $path2 ? explode('/'... | [
"protected",
"function",
"shared",
"(",
"$",
"path1",
",",
"$",
"path2",
")",
"{",
"// $path could theoretically be empty (e.g. no path is given), in which",
"// case it shouldn't expand to array(''), which would compare to one's",
"// root /",
"$",
"path1",
"=",
"$",
"path1",
... | Figure out the shared path of 2 locations.
Example:
/home/forkcms/frontend/core/layout/images/img.gif
and
/home/forkcms/frontend/cache/minified_css
share
/home/forkcms/frontend
@param string $path1
@param string $path2
@return string | [
"Figure",
"out",
"the",
"shared",
"path",
"of",
"2",
"locations",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/minify/matthiasmullie-pathconverter/src/Converter.php#L101-L121 |
212,552 | moodle/moodle | lib/minify/matthiasmullie-pathconverter/src/Converter.php | Converter.dirname | protected function dirname($path)
{
if (is_file($path)) {
return dirname($path);
}
if (is_dir($path)) {
return rtrim($path, '/');
}
// no known file/dir, start making assumptions
// ends in / = dir
if (mb_substr($path, -1) === '/') {... | php | protected function dirname($path)
{
if (is_file($path)) {
return dirname($path);
}
if (is_dir($path)) {
return rtrim($path, '/');
}
// no known file/dir, start making assumptions
// ends in / = dir
if (mb_substr($path, -1) === '/') {... | [
"protected",
"function",
"dirname",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"path",
")",
")",
"{",
"return",
"dirname",
"(",
"$",
"path",
")",
";",
"}",
"if",
"(",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"return",
"rtrim",
... | Attempt to get the directory name from a path.
@param string $path
@return string | [
"Attempt",
"to",
"get",
"the",
"directory",
"name",
"from",
"a",
"path",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/minify/matthiasmullie-pathconverter/src/Converter.php#L170-L194 |
212,553 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/SearchCharset.php | Horde_Imap_Client_Data_SearchCharset.query | public function query($charset, $cached = false)
{
$charset = Horde_String::upper($charset);
if (isset($this->_charsets[$charset])) {
return $this->_charsets[$charset];
} elseif ($cached) {
return null;
}
if (!$this->_baseob) {
throw new ... | php | public function query($charset, $cached = false)
{
$charset = Horde_String::upper($charset);
if (isset($this->_charsets[$charset])) {
return $this->_charsets[$charset];
} elseif ($cached) {
return null;
}
if (!$this->_baseob) {
throw new ... | [
"public",
"function",
"query",
"(",
"$",
"charset",
",",
"$",
"cached",
"=",
"false",
")",
"{",
"$",
"charset",
"=",
"Horde_String",
"::",
"upper",
"(",
"$",
"charset",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_charsets",
"[",
"$",
"c... | Query the validity of a charset.
@param string $charset The charset to query.
@param boolean $cached If true, only query cached values.
@return boolean True if the charset is valid for searching. | [
"Query",
"the",
"validity",
"of",
"a",
"charset",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/SearchCharset.php#L78-L112 |
212,554 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/SearchCharset.php | Horde_Imap_Client_Data_SearchCharset.setValid | public function setValid($charset, $valid = true)
{
$charset = Horde_String::upper($charset);
$valid = (bool)$valid;
if (!isset($this->_charsets[$charset]) ||
($this->_charsets[$charset] !== $valid)) {
$this->_charsets[$charset] = $valid;
$this->notify();... | php | public function setValid($charset, $valid = true)
{
$charset = Horde_String::upper($charset);
$valid = (bool)$valid;
if (!isset($this->_charsets[$charset]) ||
($this->_charsets[$charset] !== $valid)) {
$this->_charsets[$charset] = $valid;
$this->notify();... | [
"public",
"function",
"setValid",
"(",
"$",
"charset",
",",
"$",
"valid",
"=",
"true",
")",
"{",
"$",
"charset",
"=",
"Horde_String",
"::",
"upper",
"(",
"$",
"charset",
")",
";",
"$",
"valid",
"=",
"(",
"bool",
")",
"$",
"valid",
";",
"if",
"(",
... | Set the validity of a given charset.
@param string $charset The charset.
@param boolean $valid Is charset valid? | [
"Set",
"the",
"validity",
"of",
"a",
"given",
"charset",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/SearchCharset.php#L120-L130 |
212,555 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.new_redis | protected function new_redis($server, $prefix = '', $password = '') {
$redis = new Redis();
$port = null;
if (strpos($server, ':')) {
$serverconf = explode(':', $server);
$server = $serverconf[0];
$port = $serverconf[1];
}
if ($redis->connect($... | php | protected function new_redis($server, $prefix = '', $password = '') {
$redis = new Redis();
$port = null;
if (strpos($server, ':')) {
$serverconf = explode(':', $server);
$server = $serverconf[0];
$port = $serverconf[1];
}
if ($redis->connect($... | [
"protected",
"function",
"new_redis",
"(",
"$",
"server",
",",
"$",
"prefix",
"=",
"''",
",",
"$",
"password",
"=",
"''",
")",
"{",
"$",
"redis",
"=",
"new",
"Redis",
"(",
")",
";",
"$",
"port",
"=",
"null",
";",
"if",
"(",
"strpos",
"(",
"$",
... | Create a new Redis instance and
connect to the server.
@param string $server The server connection string
@param string $prefix The key prefix
@param string $password The server connection password
@return Redis | [
"Create",
"a",
"new",
"Redis",
"instance",
"and",
"connect",
"to",
"the",
"server",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L151-L173 |
212,556 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.ping | protected function ping(Redis $redis) {
try {
if ($redis->ping() === false) {
return false;
}
} catch (Exception $e) {
return false;
}
return true;
} | php | protected function ping(Redis $redis) {
try {
if ($redis->ping() === false) {
return false;
}
} catch (Exception $e) {
return false;
}
return true;
} | [
"protected",
"function",
"ping",
"(",
"Redis",
"$",
"redis",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"redis",
"->",
"ping",
"(",
")",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"}",
"catch",
"(",
"Exception",
"$",
"e",
")",
"{",
"return... | See if we can ping Redis server
@param Redis $redis
@return bool | [
"See",
"if",
"we",
"can",
"ping",
"Redis",
"server"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L181-L190 |
212,557 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.initialise | public function initialise(cache_definition $definition) {
$this->definition = $definition;
$this->hash = $definition->generate_definition_hash();
return true;
} | php | public function initialise(cache_definition $definition) {
$this->definition = $definition;
$this->hash = $definition->generate_definition_hash();
return true;
} | [
"public",
"function",
"initialise",
"(",
"cache_definition",
"$",
"definition",
")",
"{",
"$",
"this",
"->",
"definition",
"=",
"$",
"definition",
";",
"$",
"this",
"->",
"hash",
"=",
"$",
"definition",
"->",
"generate_definition_hash",
"(",
")",
";",
"retur... | Initialize the store.
@param cache_definition $definition
@return bool | [
"Initialize",
"the",
"store",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L207-L211 |
212,558 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.set | public function set($key, $value) {
return ($this->redis->hSet($this->hash, $key, $value) !== false);
} | php | public function set($key, $value) {
return ($this->redis->hSet($this->hash, $key, $value) !== false);
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"redis",
"->",
"hSet",
"(",
"$",
"this",
"->",
"hash",
",",
"$",
"key",
",",
"$",
"value",
")",
"!==",
"false",
")",
";",
"}"
] | Set the value of a key.
@param string $key The key to set the value of.
@param mixed $value The value.
@return bool True if the operation succeeded, false otherwise. | [
"Set",
"the",
"value",
"of",
"a",
"key",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L258-L260 |
212,559 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.set_many | public function set_many(array $keyvaluearray) {
$pairs = [];
foreach ($keyvaluearray as $pair) {
$pairs[$pair['key']] = $pair['value'];
}
if ($this->redis->hMSet($this->hash, $pairs)) {
return count($pairs);
}
return 0;
} | php | public function set_many(array $keyvaluearray) {
$pairs = [];
foreach ($keyvaluearray as $pair) {
$pairs[$pair['key']] = $pair['value'];
}
if ($this->redis->hMSet($this->hash, $pairs)) {
return count($pairs);
}
return 0;
} | [
"public",
"function",
"set_many",
"(",
"array",
"$",
"keyvaluearray",
")",
"{",
"$",
"pairs",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"keyvaluearray",
"as",
"$",
"pair",
")",
"{",
"$",
"pairs",
"[",
"$",
"pair",
"[",
"'key'",
"]",
"]",
"=",
"$",
... | Set the values of many keys.
@param array $keyvaluearray An array of key/value pairs. Each item in the array is an associative array
with two keys, 'key' and 'value'.
@return int The number of key/value pairs successfuly set. | [
"Set",
"the",
"values",
"of",
"many",
"keys",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L269-L278 |
212,560 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.delete_many | public function delete_many(array $keys) {
// Redis needs the hash as the first argument, so we have to put it at the start of the array.
array_unshift($keys, $this->hash);
return call_user_func_array(array($this->redis, 'hDel'), $keys);
} | php | public function delete_many(array $keys) {
// Redis needs the hash as the first argument, so we have to put it at the start of the array.
array_unshift($keys, $this->hash);
return call_user_func_array(array($this->redis, 'hDel'), $keys);
} | [
"public",
"function",
"delete_many",
"(",
"array",
"$",
"keys",
")",
"{",
"// Redis needs the hash as the first argument, so we have to put it at the start of the array.",
"array_unshift",
"(",
"$",
"keys",
",",
"$",
"this",
"->",
"hash",
")",
";",
"return",
"call_user_fu... | Delete many keys.
@param array $keys The keys to delete.
@return int The number of keys successfully deleted. | [
"Delete",
"many",
"keys",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L296-L300 |
212,561 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.has_any | public function has_any(array $keys) {
foreach ($keys as $key) {
if ($this->has($key)) {
return true;
}
}
return false;
} | php | public function has_any(array $keys) {
foreach ($keys as $key) {
if ($this->has($key)) {
return true;
}
}
return false;
} | [
"public",
"function",
"has_any",
"(",
"array",
"$",
"keys",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"fals... | Determines if the store has any of the keys in a list.
@see cache_is_key_aware
@param array $keys The keys to check for.
@return bool True if any of the keys are found, false none of the keys are found. | [
"Determines",
"if",
"the",
"store",
"has",
"any",
"of",
"the",
"keys",
"in",
"a",
"list",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L338-L345 |
212,562 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.has_all | public function has_all(array $keys) {
foreach ($keys as $key) {
if (!$this->has($key)) {
return false;
}
}
return true;
} | php | public function has_all(array $keys) {
foreach ($keys as $key) {
if (!$this->has($key)) {
return false;
}
}
return true;
} | [
"public",
"function",
"has_all",
"(",
"array",
"$",
"keys",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"return",
"false",
";",
"}",
"}",
"return",... | Determines if the store has all of the keys in a list.
@see cache_is_key_aware
@param array $keys The keys to check for.
@return bool True if all of the keys are found, false otherwise. | [
"Determines",
"if",
"the",
"store",
"has",
"all",
"of",
"the",
"keys",
"in",
"a",
"list",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L354-L361 |
212,563 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.check_lock_state | public function check_lock_state($key, $ownerid) {
$result = $this->redis->get($key);
if ($result === $ownerid) {
return true;
}
if ($result === false) {
return null;
}
return false;
} | php | public function check_lock_state($key, $ownerid) {
$result = $this->redis->get($key);
if ($result === $ownerid) {
return true;
}
if ($result === false) {
return null;
}
return false;
} | [
"public",
"function",
"check_lock_state",
"(",
"$",
"key",
",",
"$",
"ownerid",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"redis",
"->",
"get",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"result",
"===",
"$",
"ownerid",
")",
"{",
"return",
... | Checks a lock with a given name and owner information.
@see cache_is_lockable
@param string $key Name of the lock to check.
@param string $ownerid Owner information to check existing lock against.
@return mixed True if the lock exists and the owner information matches, null if the lock does not
exist, and false otherw... | [
"Checks",
"a",
"lock",
"with",
"a",
"given",
"name",
"and",
"owner",
"information",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L384-L393 |
212,564 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.release_lock | public function release_lock($key, $ownerid) {
if ($this->check_lock_state($key, $ownerid)) {
return ($this->redis->del($key) !== false);
}
return false;
} | php | public function release_lock($key, $ownerid) {
if ($this->check_lock_state($key, $ownerid)) {
return ($this->redis->del($key) !== false);
}
return false;
} | [
"public",
"function",
"release_lock",
"(",
"$",
"key",
",",
"$",
"ownerid",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check_lock_state",
"(",
"$",
"key",
",",
"$",
"ownerid",
")",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"redis",
"->",
"del",
"("... | Releases a given lock if the owner information matches.
@see cache_is_lockable
@param string $key Name of the lock to release.
@param string $ownerid Owner information to use.
@return bool True if the lock is released, false if it is not. | [
"Releases",
"a",
"given",
"lock",
"if",
"the",
"owner",
"information",
"matches",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L429-L434 |
212,565 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.config_get_configuration_array | public static function config_get_configuration_array($data) {
return array(
'server' => $data->server,
'prefix' => $data->prefix,
'password' => $data->password,
'serializer' => $data->serializer
);
} | php | public static function config_get_configuration_array($data) {
return array(
'server' => $data->server,
'prefix' => $data->prefix,
'password' => $data->password,
'serializer' => $data->serializer
);
} | [
"public",
"static",
"function",
"config_get_configuration_array",
"(",
"$",
"data",
")",
"{",
"return",
"array",
"(",
"'server'",
"=>",
"$",
"data",
"->",
"server",
",",
"'prefix'",
"=>",
"$",
"data",
"->",
"prefix",
",",
"'password'",
"=>",
"$",
"data",
"... | Creates a configuration array from given 'add instance' form data.
@see cache_is_configurable
@param stdClass $data
@return array | [
"Creates",
"a",
"configuration",
"array",
"from",
"given",
"add",
"instance",
"form",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L443-L450 |
212,566 | moodle/moodle | cache/stores/redis/lib.php | cachestore_redis.config_set_edit_form_data | public static function config_set_edit_form_data(moodleform $editform, array $config) {
$data = array();
$data['server'] = $config['server'];
$data['prefix'] = !empty($config['prefix']) ? $config['prefix'] : '';
$data['password'] = !empty($config['password']) ? $config['password'] : '';
... | php | public static function config_set_edit_form_data(moodleform $editform, array $config) {
$data = array();
$data['server'] = $config['server'];
$data['prefix'] = !empty($config['prefix']) ? $config['prefix'] : '';
$data['password'] = !empty($config['password']) ? $config['password'] : '';
... | [
"public",
"static",
"function",
"config_set_edit_form_data",
"(",
"moodleform",
"$",
"editform",
",",
"array",
"$",
"config",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"data",
"[",
"'server'",
"]",
"=",
"$",
"config",
"[",
"'server'",
"]",... | Sets form data from a configuration array.
@see cache_is_configurable
@param moodleform $editform
@param array $config | [
"Sets",
"form",
"data",
"from",
"a",
"configuration",
"array",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/redis/lib.php#L459-L468 |
212,567 | moodle/moodle | lib/php-css-parser/RuleSet/RuleSet.php | RuleSet.getRules | public function getRules($mRule = null) {
if ($mRule instanceof Rule) {
$mRule = $mRule->getRule();
}
$aResult = array();
foreach($this->aRules as $sName => $aRules) {
// Either no search rule is given or the search rule matches the found rule exactly or the search rule ends in “-” and the found rule star... | php | public function getRules($mRule = null) {
if ($mRule instanceof Rule) {
$mRule = $mRule->getRule();
}
$aResult = array();
foreach($this->aRules as $sName => $aRules) {
// Either no search rule is given or the search rule matches the found rule exactly or the search rule ends in “-” and the found rule star... | [
"public",
"function",
"getRules",
"(",
"$",
"mRule",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"mRule",
"instanceof",
"Rule",
")",
"{",
"$",
"mRule",
"=",
"$",
"mRule",
"->",
"getRule",
"(",
")",
";",
"}",
"$",
"aResult",
"=",
"array",
"(",
")",
";"... | Returns all rules matching the given rule name
@param (null|string|Rule) $mRule pattern to search for. If null, returns all rules. if the pattern ends with a dash, all rules starting with the pattern are returned as well as one matching the pattern with the dash excluded. passing a Rule behaves like calling getRules($m... | [
"Returns",
"all",
"rules",
"matching",
"the",
"given",
"rule",
"name"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/php-css-parser/RuleSet/RuleSet.php#L56-L68 |
212,568 | moodle/moodle | lib/php-css-parser/RuleSet/RuleSet.php | RuleSet.setRules | public function setRules(array $aRules) {
$this->aRules = array();
foreach ($aRules as $rule) {
$this->addRule($rule);
}
} | php | public function setRules(array $aRules) {
$this->aRules = array();
foreach ($aRules as $rule) {
$this->addRule($rule);
}
} | [
"public",
"function",
"setRules",
"(",
"array",
"$",
"aRules",
")",
"{",
"$",
"this",
"->",
"aRules",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"aRules",
"as",
"$",
"rule",
")",
"{",
"$",
"this",
"->",
"addRule",
"(",
"$",
"rule",
")",
";... | Override all the rules of this set.
@param array $aRules The rules to override with. | [
"Override",
"all",
"the",
"rules",
"of",
"this",
"set",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/php-css-parser/RuleSet/RuleSet.php#L74-L79 |
212,569 | moodle/moodle | lib/php-css-parser/RuleSet/RuleSet.php | RuleSet.removeRule | public function removeRule($mRule) {
if($mRule instanceof Rule) {
$sRule = $mRule->getRule();
if(!isset($this->aRules[$sRule])) {
return;
}
foreach($this->aRules[$sRule] as $iKey => $oRule) {
if($oRule === $mRule) {
unset($this->aRules[$sRule][$iKey]);
}
}
} else {
foreach($this->... | php | public function removeRule($mRule) {
if($mRule instanceof Rule) {
$sRule = $mRule->getRule();
if(!isset($this->aRules[$sRule])) {
return;
}
foreach($this->aRules[$sRule] as $iKey => $oRule) {
if($oRule === $mRule) {
unset($this->aRules[$sRule][$iKey]);
}
}
} else {
foreach($this->... | [
"public",
"function",
"removeRule",
"(",
"$",
"mRule",
")",
"{",
"if",
"(",
"$",
"mRule",
"instanceof",
"Rule",
")",
"{",
"$",
"sRule",
"=",
"$",
"mRule",
"->",
"getRule",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"aRules",
... | Remove a rule from this RuleSet. This accepts all the possible values that @link{getRules()} accepts. If given a Rule, it will only remove this particular rule (by identity). If given a name, it will remove all rules by that name. Note: this is different from pre-v.2.0 behaviour of PHP-CSS-Parser, where passing a Rule ... | [
"Remove",
"a",
"rule",
"from",
"this",
"RuleSet",
".",
"This",
"accepts",
"all",
"the",
"possible",
"values",
"that"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/php-css-parser/RuleSet/RuleSet.php#L98-L117 |
212,570 | moodle/moodle | admin/tool/log/store/database/classes/privacy/provider.php | provider.get_database_and_table | protected static function get_database_and_table() {
$manager = get_log_manager();
$store = new \logstore_database\log\store($manager);
$db = $store->get_extdb();
return $db ? [$db, $store->get_config_value('dbtable')] : [null, null];
} | php | protected static function get_database_and_table() {
$manager = get_log_manager();
$store = new \logstore_database\log\store($manager);
$db = $store->get_extdb();
return $db ? [$db, $store->get_config_value('dbtable')] : [null, null];
} | [
"protected",
"static",
"function",
"get_database_and_table",
"(",
")",
"{",
"$",
"manager",
"=",
"get_log_manager",
"(",
")",
";",
"$",
"store",
"=",
"new",
"\\",
"logstore_database",
"\\",
"log",
"\\",
"store",
"(",
"$",
"manager",
")",
";",
"$",
"db",
... | Get the database object.
@return array Containing moodle_database, string, or null values. | [
"Get",
"the",
"database",
"object",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/log/store/database/classes/privacy/provider.php#L132-L137 |
212,571 | moodle/moodle | competency/classes/user_evidence_competency.php | user_evidence_competency.get_competencies_by_userevidenceid | public static function get_competencies_by_userevidenceid($userevidenceid) {
global $DB;
$sql = "SELECT c.*
FROM {" . self::TABLE . "} uec
JOIN {" . competency::TABLE . "} c
ON uec.userevidenceid = ?
AND uec.competencyid = c.id
... | php | public static function get_competencies_by_userevidenceid($userevidenceid) {
global $DB;
$sql = "SELECT c.*
FROM {" . self::TABLE . "} uec
JOIN {" . competency::TABLE . "} c
ON uec.userevidenceid = ?
AND uec.competencyid = c.id
... | [
"public",
"static",
"function",
"get_competencies_by_userevidenceid",
"(",
"$",
"userevidenceid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"\"SELECT c.*\n FROM {\"",
".",
"self",
"::",
"TABLE",
".",
"\"} uec\n JOIN {\"",
"."... | Get competencies by user evidence ID.
@param int $userevidenceid The user evidence ID.
@return competency[] | [
"Get",
"competencies",
"by",
"user",
"evidence",
"ID",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_evidence_competency.php#L92-L107 |
212,572 | moodle/moodle | competency/classes/user_evidence_competency.php | user_evidence_competency.get_user_competencies_by_userevidenceid | public static function get_user_competencies_by_userevidenceid($userevidenceid) {
global $DB;
$sql = "SELECT uc.*
FROM {" . user_competency::TABLE . "} uc
JOIN {" . self::TABLE . "} uec
ON uc.competencyid = uec.competencyid
JOIN ... | php | public static function get_user_competencies_by_userevidenceid($userevidenceid) {
global $DB;
$sql = "SELECT uc.*
FROM {" . user_competency::TABLE . "} uc
JOIN {" . self::TABLE . "} uec
ON uc.competencyid = uec.competencyid
JOIN ... | [
"public",
"static",
"function",
"get_user_competencies_by_userevidenceid",
"(",
"$",
"userevidenceid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"\"SELECT uc.*\n FROM {\"",
".",
"user_competency",
"::",
"TABLE",
".",
"\"} uc\n ... | Get user competencies by user evidence ID.
@param int $userevidenceid The user evidence ID.
@return user_competency[] | [
"Get",
"user",
"competencies",
"by",
"user",
"evidence",
"ID",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_evidence_competency.php#L115-L135 |
212,573 | moodle/moodle | competency/classes/user_evidence_competency.php | user_evidence_competency.delete_by_competencyids | public static function delete_by_competencyids($competencyids) {
global $DB;
if (empty($competencyids)) {
return true;
}
list($insql, $params) = $DB->get_in_or_equal($competencyids);
return $DB->delete_records_select(self::TABLE, "competencyid $insql", $params);
} | php | public static function delete_by_competencyids($competencyids) {
global $DB;
if (empty($competencyids)) {
return true;
}
list($insql, $params) = $DB->get_in_or_equal($competencyids);
return $DB->delete_records_select(self::TABLE, "competencyid $insql", $params);
} | [
"public",
"static",
"function",
"delete_by_competencyids",
"(",
"$",
"competencyids",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"empty",
"(",
"$",
"competencyids",
")",
")",
"{",
"return",
"true",
";",
"}",
"list",
"(",
"$",
"insql",
",",
"$",
"pa... | Delete evidences using competencies.
@param array $competencyids Array of competencies ids.
@return bool Return true if the delete was successful. | [
"Delete",
"evidences",
"using",
"competencies",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_evidence_competency.php#L169-L176 |
212,574 | moodle/moodle | rating/classes/external.php | core_rating_external.get_item_ratings_parameters | public static function get_item_ratings_parameters() {
return new external_function_parameters (
array(
'contextlevel' => new external_value(PARAM_ALPHA, 'context level: course, module, user, etc...'),
'instanceid' => new external_value(PARAM_INT, 'the instance id... | php | public static function get_item_ratings_parameters() {
return new external_function_parameters (
array(
'contextlevel' => new external_value(PARAM_ALPHA, 'context level: course, module, user, etc...'),
'instanceid' => new external_value(PARAM_INT, 'the instance id... | [
"public",
"static",
"function",
"get_item_ratings_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'contextlevel'",
"=>",
"new",
"external_value",
"(",
"PARAM_ALPHA",
",",
"'context level: course, module, user, etc...'",
")",
... | Returns description of get_item_ratings parameters.
@return external_function_parameters
@since Moodle 2.9 | [
"Returns",
"description",
"of",
"get_item_ratings",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/rating/classes/external.php#L49-L61 |
212,575 | moodle/moodle | rating/classes/external.php | core_rating_external.get_item_ratings_returns | public static function get_item_ratings_returns() {
return new external_single_structure(
array(
'ratings' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new ex... | php | public static function get_item_ratings_returns() {
return new external_single_structure(
array(
'ratings' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new ex... | [
"public",
"static",
"function",
"get_item_ratings_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'ratings'",
"=>",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>... | Returns description of get_item_ratings result values.
@return external_single_structure
@since Moodle 2.9 | [
"Returns",
"description",
"of",
"get_item_ratings",
"result",
"values",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/rating/classes/external.php#L177-L196 |
212,576 | moodle/moodle | rating/classes/external.php | core_rating_external.add_rating_parameters | public static function add_rating_parameters() {
return new external_function_parameters (
array(
'contextlevel' => new external_value(PARAM_ALPHA, 'context level: course, module, user, etc...'),
'instanceid' => new external_value(PARAM_INT, 'the instance id of it... | php | public static function add_rating_parameters() {
return new external_function_parameters (
array(
'contextlevel' => new external_value(PARAM_ALPHA, 'context level: course, module, user, etc...'),
'instanceid' => new external_value(PARAM_INT, 'the instance id of it... | [
"public",
"static",
"function",
"add_rating_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'contextlevel'",
"=>",
"new",
"external_value",
"(",
"PARAM_ALPHA",
",",
"'context level: course, module, user, etc...'",
")",
",",... | Returns description of add_rating parameters.
@return external_function_parameters
@since Moodle 3.2 | [
"Returns",
"description",
"of",
"add_rating",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/rating/classes/external.php#L204-L218 |
212,577 | moodle/moodle | rating/classes/external.php | core_rating_external.add_rating | public static function add_rating($contextlevel, $instanceid, $component, $ratingarea, $itemid, $scaleid, $rating, $rateduserid,
$aggregation = RATING_AGGREGATE_NONE) {
$warnings = array();
$params = array(
'contextlevel' => $contextlevel,
... | php | public static function add_rating($contextlevel, $instanceid, $component, $ratingarea, $itemid, $scaleid, $rating, $rateduserid,
$aggregation = RATING_AGGREGATE_NONE) {
$warnings = array();
$params = array(
'contextlevel' => $contextlevel,
... | [
"public",
"static",
"function",
"add_rating",
"(",
"$",
"contextlevel",
",",
"$",
"instanceid",
",",
"$",
"component",
",",
"$",
"ratingarea",
",",
"$",
"itemid",
",",
"$",
"scaleid",
",",
"$",
"rating",
",",
"$",
"rateduserid",
",",
"$",
"aggregation",
... | Adds a rating to an item
@param string $contextlevel course, module, user...
@param int $instanceid the instance if for the context element
@param string $component the name of the component
@param string $ratingarea rating area
@param int $itemid the item id
@param int $scaleid the scale id
@param int $rating the use... | [
"Adds",
"a",
"rating",
"to",
"an",
"item"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/rating/classes/external.php#L236-L281 |
212,578 | moodle/moodle | rating/classes/external.php | core_rating_external.add_rating_returns | public static function add_rating_returns() {
return new external_single_structure(
array(
'success' => new external_value(PARAM_BOOL, 'Whether the rate was successfully created'),
'aggregate' => new external_value(PARAM_TEXT, 'New aggregate', VALUE_OPTIONAL),
... | php | public static function add_rating_returns() {
return new external_single_structure(
array(
'success' => new external_value(PARAM_BOOL, 'Whether the rate was successfully created'),
'aggregate' => new external_value(PARAM_TEXT, 'New aggregate', VALUE_OPTIONAL),
... | [
"public",
"static",
"function",
"add_rating_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'success'",
"=>",
"new",
"external_value",
"(",
"PARAM_BOOL",
",",
"'Whether the rate was successfully created'",
")",
",",
"'aggregate... | Returns description of add_rating result values.
@return external_single_structure
@since Moodle 3.2 | [
"Returns",
"description",
"of",
"add_rating",
"result",
"values",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/rating/classes/external.php#L289-L300 |
212,579 | moodle/moodle | mod/feedback/classes/event/response_submitted.php | response_submitted.init | protected function init() {
global $CFG;
require_once($CFG->dirroot.'/mod/feedback/lib.php');
$this->data['objecttable'] = 'feedback_completed';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
} | php | protected function init() {
global $CFG;
require_once($CFG->dirroot.'/mod/feedback/lib.php');
$this->data['objecttable'] = 'feedback_completed';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
} | [
"protected",
"function",
"init",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mod/feedback/lib.php'",
")",
";",
"$",
"this",
"->",
"data",
"[",
"'objecttable'",
"]",
"=",
"'feedback_completed'",
";",
"... | Set basic properties for the event. | [
"Set",
"basic",
"properties",
"for",
"the",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/event/response_submitted.php#L51-L58 |
212,580 | moodle/moodle | mod/feedback/classes/event/response_submitted.php | response_submitted.create_from_record | public static function create_from_record($completed, $cm) {
$event = self::create(array(
'relateduserid' => $completed->userid,
'objectid' => $completed->id,
'context' => \context_module::instance($cm->id),
'anonymous' => ($completed->anonymous_response == FEEDBA... | php | public static function create_from_record($completed, $cm) {
$event = self::create(array(
'relateduserid' => $completed->userid,
'objectid' => $completed->id,
'context' => \context_module::instance($cm->id),
'anonymous' => ($completed->anonymous_response == FEEDBA... | [
"public",
"static",
"function",
"create_from_record",
"(",
"$",
"completed",
",",
"$",
"cm",
")",
"{",
"$",
"event",
"=",
"self",
"::",
"create",
"(",
"array",
"(",
"'relateduserid'",
"=>",
"$",
"completed",
"->",
"userid",
",",
"'objectid'",
"=>",
"$",
... | Creates an instance from the record from db table feedback_completed
@param stdClass $completed
@param stdClass|cm_info $cm
@return self | [
"Creates",
"an",
"instance",
"from",
"the",
"record",
"from",
"db",
"table",
"feedback_completed"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/event/response_submitted.php#L67-L81 |
212,581 | moodle/moodle | mod/feedback/classes/event/response_submitted.php | response_submitted.get_url | public function get_url() {
if ($this->anonymous) {
return new \moodle_url('/mod/feedback/show_entries.php', array('id' => $this->other['cmid'],
'showcompleted' => $this->objectid));
} else {
return new \moodle_url('/mod/feedback/show_entries.php' , array('id'... | php | public function get_url() {
if ($this->anonymous) {
return new \moodle_url('/mod/feedback/show_entries.php', array('id' => $this->other['cmid'],
'showcompleted' => $this->objectid));
} else {
return new \moodle_url('/mod/feedback/show_entries.php' , array('id'... | [
"public",
"function",
"get_url",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"anonymous",
")",
"{",
"return",
"new",
"\\",
"moodle_url",
"(",
"'/mod/feedback/show_entries.php'",
",",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"other",
"[",
"'cmid'",
... | Returns relevant URL based on the anonymous mode of the response.
@return \moodle_url | [
"Returns",
"relevant",
"URL",
"based",
"on",
"the",
"anonymous",
"mode",
"of",
"the",
"response",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/event/response_submitted.php#L106-L114 |
212,582 | moodle/moodle | mod/feedback/classes/event/response_submitted.php | response_submitted.can_view | public function can_view($userorid = null) {
global $USER;
debugging('can_view() method is deprecated, use anonymous flag instead if necessary.', DEBUG_DEVELOPER);
if (empty($userorid)) {
$userorid = $USER;
}
if ($this->anonymous) {
return is_siteadmin($u... | php | public function can_view($userorid = null) {
global $USER;
debugging('can_view() method is deprecated, use anonymous flag instead if necessary.', DEBUG_DEVELOPER);
if (empty($userorid)) {
$userorid = $USER;
}
if ($this->anonymous) {
return is_siteadmin($u... | [
"public",
"function",
"can_view",
"(",
"$",
"userorid",
"=",
"null",
")",
"{",
"global",
"$",
"USER",
";",
"debugging",
"(",
"'can_view() method is deprecated, use anonymous flag instead if necessary.'",
",",
"DEBUG_DEVELOPER",
")",
";",
"if",
"(",
"empty",
"(",
"$"... | Define whether a user can view the event or not. Make sure no one except admin can see details of an anonymous response.
@deprecated since 2.7
@param int|\stdClass $userorid ID of the user.
@return bool True if the user can view the event, false otherwise. | [
"Define",
"whether",
"a",
"user",
"can",
"view",
"the",
"event",
"or",
"not",
".",
"Make",
"sure",
"no",
"one",
"except",
"admin",
"can",
"see",
"details",
"of",
"an",
"anonymous",
"response",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/event/response_submitted.php#L139-L151 |
212,583 | moodle/moodle | report/competency/classes/output/renderer.php | renderer.notify_message | public function notify_message($message) {
$n = new \core\output\notification($message, \core\output\notification::NOTIFY_INFO);
return $this->render($n);
} | php | public function notify_message($message) {
$n = new \core\output\notification($message, \core\output\notification::NOTIFY_INFO);
return $this->render($n);
} | [
"public",
"function",
"notify_message",
"(",
"$",
"message",
")",
"{",
"$",
"n",
"=",
"new",
"\\",
"core",
"\\",
"output",
"\\",
"notification",
"(",
"$",
"message",
",",
"\\",
"core",
"\\",
"output",
"\\",
"notification",
"::",
"NOTIFY_INFO",
")",
";",
... | Output a nofication.
@param string $message the message to print out
@return string HTML fragment.
@see \core\output\notification | [
"Output",
"a",
"nofication",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/competency/classes/output/renderer.php#L70-L73 |
212,584 | moodle/moodle | report/competency/classes/output/renderer.php | renderer.notify_problem | public function notify_problem($message) {
$n = new \core\output\notification($message, \core\output\notification::NOTIFY_ERROR);
return $this->render($n);
} | php | public function notify_problem($message) {
$n = new \core\output\notification($message, \core\output\notification::NOTIFY_ERROR);
return $this->render($n);
} | [
"public",
"function",
"notify_problem",
"(",
"$",
"message",
")",
"{",
"$",
"n",
"=",
"new",
"\\",
"core",
"\\",
"output",
"\\",
"notification",
"(",
"$",
"message",
",",
"\\",
"core",
"\\",
"output",
"\\",
"notification",
"::",
"NOTIFY_ERROR",
")",
";",... | Output an error notification.
@param string $message the message to print out
@return string HTML fragment.
@see \core\output\notification | [
"Output",
"an",
"error",
"notification",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/competency/classes/output/renderer.php#L82-L85 |
212,585 | moodle/moodle | report/competency/classes/output/renderer.php | renderer.notify_success | public function notify_success($message) {
$n = new \core\output\notification($message, \core\output\notification::NOTIFY_SUCCESS);
return $this->render($n);
} | php | public function notify_success($message) {
$n = new \core\output\notification($message, \core\output\notification::NOTIFY_SUCCESS);
return $this->render($n);
} | [
"public",
"function",
"notify_success",
"(",
"$",
"message",
")",
"{",
"$",
"n",
"=",
"new",
"\\",
"core",
"\\",
"output",
"\\",
"notification",
"(",
"$",
"message",
",",
"\\",
"core",
"\\",
"output",
"\\",
"notification",
"::",
"NOTIFY_SUCCESS",
")",
";... | Output a success notification.
@param string $message the message to print out
@return string HTML fragment.
@see \core\output\notification | [
"Output",
"a",
"success",
"notification",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/competency/classes/output/renderer.php#L94-L97 |
212,586 | moodle/moodle | lib/form/classes/privacy/provider.php | provider.export_user_preferences | public static function export_user_preferences(int $userid) {
$preference = get_user_preferences('filemanager_recentviewmode');
if ($preference !== null) {
switch ($preference) {
case 1:
$value = get_string('displayasicons', 'core_repository');
... | php | public static function export_user_preferences(int $userid) {
$preference = get_user_preferences('filemanager_recentviewmode');
if ($preference !== null) {
switch ($preference) {
case 1:
$value = get_string('displayasicons', 'core_repository');
... | [
"public",
"static",
"function",
"export_user_preferences",
"(",
"int",
"$",
"userid",
")",
"{",
"$",
"preference",
"=",
"get_user_preferences",
"(",
"'filemanager_recentviewmode'",
")",
";",
"if",
"(",
"$",
"preference",
"!==",
"null",
")",
"{",
"switch",
"(",
... | Export all user preferences for the subsystem.
@param int $userid The ID of the user whose data is to be exported. | [
"Export",
"all",
"user",
"preferences",
"for",
"the",
"subsystem",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/form/classes/privacy/provider.php#L65-L87 |
212,587 | moodle/moodle | admin/roles/classes/allow_role_page.php | core_role_allow_role_page.process_submission | public function process_submission() {
global $DB;
// Delete all records, then add back the ones that should be allowed.
$DB->delete_records($this->tablename);
foreach ($this->roles as $fromroleid => $notused) {
foreach ($this->roles as $targetroleid => $alsonotused) {
... | php | public function process_submission() {
global $DB;
// Delete all records, then add back the ones that should be allowed.
$DB->delete_records($this->tablename);
foreach ($this->roles as $fromroleid => $notused) {
foreach ($this->roles as $targetroleid => $alsonotused) {
... | [
"public",
"function",
"process_submission",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"// Delete all records, then add back the ones that should be allowed.",
"$",
"DB",
"->",
"delete_records",
"(",
"$",
"this",
"->",
"tablename",
")",
";",
"foreach",
"(",
"$",
"this... | Update the data with the new settings submitted by the user. | [
"Update",
"the",
"data",
"with",
"the",
"new",
"settings",
"submitted",
"by",
"the",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/roles/classes/allow_role_page.php#L60-L71 |
212,588 | moodle/moodle | admin/roles/classes/allow_role_page.php | core_role_allow_role_page.load_current_settings | public function load_current_settings() {
global $DB;
// Load the current settings.
$this->allowed = array();
foreach ($this->roles as $role) {
// Make an array $role->id => false. This is probably too clever for its own good.
$this->allowed[$role->id] = array_com... | php | public function load_current_settings() {
global $DB;
// Load the current settings.
$this->allowed = array();
foreach ($this->roles as $role) {
// Make an array $role->id => false. This is probably too clever for its own good.
$this->allowed[$role->id] = array_com... | [
"public",
"function",
"load_current_settings",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"// Load the current settings.",
"$",
"this",
"->",
"allowed",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"roles",
"as",
"$",
"role",
")",
"{",
"... | Load the current allows from the database. | [
"Load",
"the",
"current",
"allows",
"from",
"the",
"database",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/roles/classes/allow_role_page.php#L83-L96 |
212,589 | moodle/moodle | admin/roles/classes/allow_role_page.php | core_role_allow_role_page.get_table | public function get_table() {
$table = new html_table();
$table->tablealign = 'center';
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '90%';
$table->align = array('left');
$table->rotateheaders = true;
$table->head = array(' ');
... | php | public function get_table() {
$table = new html_table();
$table->tablealign = 'center';
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '90%';
$table->align = array('left');
$table->rotateheaders = true;
$table->head = array(' ');
... | [
"public",
"function",
"get_table",
"(",
")",
"{",
"$",
"table",
"=",
"new",
"html_table",
"(",
")",
";",
"$",
"table",
"->",
"tablealign",
"=",
"'center'",
";",
"$",
"table",
"->",
"cellpadding",
"=",
"5",
";",
"$",
"table",
"->",
"cellspacing",
"=",
... | Returns structure that can be passed to print_table,
containing one cell for each checkbox.
@return html_table a table | [
"Returns",
"structure",
"that",
"can",
"be",
"passed",
"to",
"print_table",
"containing",
"one",
"cell",
"for",
"each",
"checkbox",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/roles/classes/allow_role_page.php#L113-L157 |
212,590 | moodle/moodle | auth/ldap/classes/admin_setting_special_contexts_configtext.php | auth_ldap_admin_setting_special_contexts_configtext.write_setting | public function write_setting($data) {
// Try to remove duplicates before storing the contexts (to avoid problems in sync_users()).
$data = explode(';', $data);
$data = array_map(function($x) {
return core_text::strtolower(trim($x));
}, $data);
$data = implode(';', ar... | php | public function write_setting($data) {
// Try to remove duplicates before storing the contexts (to avoid problems in sync_users()).
$data = explode(';', $data);
$data = array_map(function($x) {
return core_text::strtolower(trim($x));
}, $data);
$data = implode(';', ar... | [
"public",
"function",
"write_setting",
"(",
"$",
"data",
")",
"{",
"// Try to remove duplicates before storing the contexts (to avoid problems in sync_users()).",
"$",
"data",
"=",
"explode",
"(",
"';'",
",",
"$",
"data",
")",
";",
"$",
"data",
"=",
"array_map",
"(",
... | We need to remove duplicates on save to prevent issues in other areas of Moodle.
@param string $data Form data.
@return string Empty when no errors. | [
"We",
"need",
"to",
"remove",
"duplicates",
"on",
"save",
"to",
"prevent",
"issues",
"in",
"other",
"areas",
"of",
"Moodle",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/classes/admin_setting_special_contexts_configtext.php#L42-L50 |
212,591 | moodle/moodle | admin/tool/monitor/classes/output/managerules/renderer.php | renderer.render_add_button | protected function render_add_button($courseid) {
global $CFG;
$button = \html_writer::tag('button', get_string('addrule', 'tool_monitor'), ['class' => 'btn btn-primary']);
$addurl = new \moodle_url($CFG->wwwroot. '/admin/tool/monitor/edit.php', array('courseid' => $courseid));
return \... | php | protected function render_add_button($courseid) {
global $CFG;
$button = \html_writer::tag('button', get_string('addrule', 'tool_monitor'), ['class' => 'btn btn-primary']);
$addurl = new \moodle_url($CFG->wwwroot. '/admin/tool/monitor/edit.php', array('courseid' => $courseid));
return \... | [
"protected",
"function",
"render_add_button",
"(",
"$",
"courseid",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"button",
"=",
"\\",
"html_writer",
"::",
"tag",
"(",
"'button'",
",",
"get_string",
"(",
"'addrule'",
",",
"'tool_monitor'",
")",
",",
"[",
"'cla... | Html to add a button for adding a new rule.
@param int $courseid course id.
@return string html for the button. | [
"Html",
"to",
"add",
"a",
"button",
"for",
"adding",
"a",
"new",
"rule",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/output/managerules/renderer.php#L77-L83 |
212,592 | moodle/moodle | admin/tool/monitor/classes/output/managerules/renderer.php | renderer.render_subscriptions_link | public function render_subscriptions_link($manageurl) {
echo \html_writer::start_div();
$a = \html_writer::link($manageurl, get_string('managesubscriptions', 'tool_monitor'));
$link = \html_writer::tag('span', get_string('managesubscriptionslink', 'tool_monitor', $a));
echo $link;
... | php | public function render_subscriptions_link($manageurl) {
echo \html_writer::start_div();
$a = \html_writer::link($manageurl, get_string('managesubscriptions', 'tool_monitor'));
$link = \html_writer::tag('span', get_string('managesubscriptionslink', 'tool_monitor', $a));
echo $link;
... | [
"public",
"function",
"render_subscriptions_link",
"(",
"$",
"manageurl",
")",
"{",
"echo",
"\\",
"html_writer",
"::",
"start_div",
"(",
")",
";",
"$",
"a",
"=",
"\\",
"html_writer",
"::",
"link",
"(",
"$",
"manageurl",
",",
"get_string",
"(",
"'managesubscr... | Html to add a link to go to the subscription page.
@param moodle_url $manageurl The url of the subscription page.
@return string html for the link to the subscription page. | [
"Html",
"to",
"add",
"a",
"link",
"to",
"go",
"to",
"the",
"subscription",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/output/managerules/renderer.php#L92-L98 |
212,593 | moodle/moodle | mod/forum/classes/local/managers/capability.php | capability.can_subscribe_to_forum | public function can_subscribe_to_forum(stdClass $user) : bool {
if ($this->forum->get_type() == 'single') {
return false;
}
return !is_guest($this->get_context(), $user) &&
subscriptions::is_subscribable($this->get_forum_record());
} | php | public function can_subscribe_to_forum(stdClass $user) : bool {
if ($this->forum->get_type() == 'single') {
return false;
}
return !is_guest($this->get_context(), $user) &&
subscriptions::is_subscribable($this->get_forum_record());
} | [
"public",
"function",
"can_subscribe_to_forum",
"(",
"stdClass",
"$",
"user",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"forum",
"->",
"get_type",
"(",
")",
"==",
"'single'",
")",
"{",
"return",
"false",
";",
"}",
"return",
"!",
"is_guest",
... | Can the user subscribe to this forum?
@param stdClass $user The user to check
@return bool | [
"Can",
"the",
"user",
"subscribe",
"to",
"this",
"forum?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L92-L99 |
212,594 | moodle/moodle | mod/forum/classes/local/managers/capability.php | capability.can_create_discussions | public function can_create_discussions(stdClass $user, int $groupid = null) : bool {
if (isguestuser($user) or !isloggedin()) {
return false;
}
if ($this->forum->is_cutoff_date_reached()) {
if (!has_capability('mod/forum:canoverridecutoff', $this->get_context())) {
... | php | public function can_create_discussions(stdClass $user, int $groupid = null) : bool {
if (isguestuser($user) or !isloggedin()) {
return false;
}
if ($this->forum->is_cutoff_date_reached()) {
if (!has_capability('mod/forum:canoverridecutoff', $this->get_context())) {
... | [
"public",
"function",
"can_create_discussions",
"(",
"stdClass",
"$",
"user",
",",
"int",
"$",
"groupid",
"=",
"null",
")",
":",
"bool",
"{",
"if",
"(",
"isguestuser",
"(",
"$",
"user",
")",
"or",
"!",
"isloggedin",
"(",
")",
")",
"{",
"return",
"false... | Can the user create discussions in this forum?
@param stdClass $user The user to check
@param int|null $groupid The current activity group id
@return bool | [
"Can",
"the",
"user",
"create",
"discussions",
"in",
"this",
"forum?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L108-L145 |
212,595 | moodle/moodle | mod/forum/classes/local/managers/capability.php | capability.can_access_group | public function can_access_group(stdClass $user, int $groupid) : bool {
if ($this->can_access_all_groups($user)) {
// This user has access to all groups.
return true;
}
// This is a group discussion for a forum in separate groups mode.
// Check if the user is a m... | php | public function can_access_group(stdClass $user, int $groupid) : bool {
if ($this->can_access_all_groups($user)) {
// This user has access to all groups.
return true;
}
// This is a group discussion for a forum in separate groups mode.
// Check if the user is a m... | [
"public",
"function",
"can_access_group",
"(",
"stdClass",
"$",
"user",
",",
"int",
"$",
"groupid",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"can_access_all_groups",
"(",
"$",
"user",
")",
")",
"{",
"// This user has access to all groups.",
"return... | Can the user access the given group?
@param stdClass $user The user to check
@param int $groupid The id of the group that the forum is set to
@return bool | [
"Can",
"the",
"user",
"access",
"the",
"given",
"group?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L164-L174 |
212,596 | moodle/moodle | mod/forum/classes/local/managers/capability.php | capability.can_pin_discussions | public function can_pin_discussions(stdClass $user) : bool {
return $this->forum->get_type() !== 'single' &&
has_capability('mod/forum:pindiscussions', $this->get_context(), $user);
} | php | public function can_pin_discussions(stdClass $user) : bool {
return $this->forum->get_type() !== 'single' &&
has_capability('mod/forum:pindiscussions', $this->get_context(), $user);
} | [
"public",
"function",
"can_pin_discussions",
"(",
"stdClass",
"$",
"user",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"forum",
"->",
"get_type",
"(",
")",
"!==",
"'single'",
"&&",
"has_capability",
"(",
"'mod/forum:pindiscussions'",
",",
"$",
"this",
... | Can the user pin discussions in this forum?
@param stdClass $user The user to check
@return bool | [
"Can",
"the",
"user",
"pin",
"discussions",
"in",
"this",
"forum?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L214-L217 |
212,597 | moodle/moodle | mod/forum/classes/local/managers/capability.php | capability.can_split_discussions | public function can_split_discussions(stdClass $user) : bool {
$forum = $this->get_forum();
return $forum->get_type() !== 'single' && has_capability('mod/forum:splitdiscussions', $this->get_context(), $user);
} | php | public function can_split_discussions(stdClass $user) : bool {
$forum = $this->get_forum();
return $forum->get_type() !== 'single' && has_capability('mod/forum:splitdiscussions', $this->get_context(), $user);
} | [
"public",
"function",
"can_split_discussions",
"(",
"stdClass",
"$",
"user",
")",
":",
"bool",
"{",
"$",
"forum",
"=",
"$",
"this",
"->",
"get_forum",
"(",
")",
";",
"return",
"$",
"forum",
"->",
"get_type",
"(",
")",
"!==",
"'single'",
"&&",
"has_capabi... | Can the user split discussions in this forum?
@param stdClass $user The user to check
@return bool | [
"Can",
"the",
"user",
"split",
"discussions",
"in",
"this",
"forum?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L225-L228 |
212,598 | moodle/moodle | mod/forum/classes/local/managers/capability.php | capability.must_post_before_viewing_discussion | public function must_post_before_viewing_discussion(stdClass $user, discussion_entity $discussion) : bool {
$forum = $this->get_forum();
if ($forum->get_type() === 'qanda') {
// If it's a Q and A forum then the user must either have the capability to view without
// posting or t... | php | public function must_post_before_viewing_discussion(stdClass $user, discussion_entity $discussion) : bool {
$forum = $this->get_forum();
if ($forum->get_type() === 'qanda') {
// If it's a Q and A forum then the user must either have the capability to view without
// posting or t... | [
"public",
"function",
"must_post_before_viewing_discussion",
"(",
"stdClass",
"$",
"user",
",",
"discussion_entity",
"$",
"discussion",
")",
":",
"bool",
"{",
"$",
"forum",
"=",
"$",
"this",
"->",
"get_forum",
"(",
")",
";",
"if",
"(",
"$",
"forum",
"->",
... | Is the user required to post in the discussion before they can view it?
@param stdClass $user The user to check
@param discussion_entity $discussion The discussion to check
@return bool | [
"Is",
"the",
"user",
"required",
"to",
"post",
"in",
"the",
"discussion",
"before",
"they",
"can",
"view",
"it?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L259-L271 |
212,599 | moodle/moodle | mod/forum/classes/local/managers/capability.php | capability.can_post_in_discussion | public function can_post_in_discussion(stdClass $user, discussion_entity $discussion) : bool {
$forum = $this->get_forum();
$forumrecord = $this->get_forum_record();
$discussionrecord = $this->get_discussion_record($discussion);
$context = $this->get_context();
$coursemodule = $f... | php | public function can_post_in_discussion(stdClass $user, discussion_entity $discussion) : bool {
$forum = $this->get_forum();
$forumrecord = $this->get_forum_record();
$discussionrecord = $this->get_discussion_record($discussion);
$context = $this->get_context();
$coursemodule = $f... | [
"public",
"function",
"can_post_in_discussion",
"(",
"stdClass",
"$",
"user",
",",
"discussion_entity",
"$",
"discussion",
")",
":",
"bool",
"{",
"$",
"forum",
"=",
"$",
"this",
"->",
"get_forum",
"(",
")",
";",
"$",
"forumrecord",
"=",
"$",
"this",
"->",
... | Can the user post in this discussion?
@param stdClass $user The user to check
@param discussion_entity $discussion The discussion to check
@return bool | [
"Can",
"the",
"user",
"post",
"in",
"this",
"discussion?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L313-L322 |
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.