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
220,400
moodle/moodle
lib/lessphp/Parser.php
Less_Parser.parseOperand
private function parseOperand (){ $negate = false; $offset = $this->pos+1; if( $offset >= $this->input_len ){ return; } $char = $this->input[$offset]; if( $char === '@' || $char === '(' ){ $negate = $this->MatchChar('-'); } $o = $this->MatchFuncs(array('parseSub','parseEntitiesDimension','parseE...
php
private function parseOperand (){ $negate = false; $offset = $this->pos+1; if( $offset >= $this->input_len ){ return; } $char = $this->input[$offset]; if( $char === '@' || $char === '(' ){ $negate = $this->MatchChar('-'); } $o = $this->MatchFuncs(array('parseSub','parseEntitiesDimension','parseE...
[ "private", "function", "parseOperand", "(", ")", "{", "$", "negate", "=", "false", ";", "$", "offset", "=", "$", "this", "->", "pos", "+", "1", ";", "if", "(", "$", "offset", ">=", "$", "this", "->", "input_len", ")", "{", "return", ";", "}", "$"...
An operand is anything that can be part of an operation, such as a Color, or a Variable
[ "An", "operand", "is", "anything", "that", "can", "be", "part", "of", "an", "operation", "such", "as", "a", "Color", "or", "a", "Variable" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/lessphp/Parser.php#L2352-L2372
220,401
moodle/moodle
lib/lessphp/Parser.php
Less_Parser.parseExpression
private function parseExpression (){ $entities = array(); do{ $e = $this->MatchFuncs(array('parseAddition','parseEntity')); if( $e ){ $entities[] = $e; // operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here if( !$this->PeekReg('/\\G\/[\/*]/') ){ $delim = $...
php
private function parseExpression (){ $entities = array(); do{ $e = $this->MatchFuncs(array('parseAddition','parseEntity')); if( $e ){ $entities[] = $e; // operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here if( !$this->PeekReg('/\\G\/[\/*]/') ){ $delim = $...
[ "private", "function", "parseExpression", "(", ")", "{", "$", "entities", "=", "array", "(", ")", ";", "do", "{", "$", "e", "=", "$", "this", "->", "MatchFuncs", "(", "array", "(", "'parseAddition'", ",", "'parseEntity'", ")", ")", ";", "if", "(", "$...
Expressions either represent mathematical operations, or white-space delimited Entities. 1px solid black @var * 2 @return Less_Tree_Expression|null
[ "Expressions", "either", "represent", "mathematical", "operations", "or", "white", "-", "space", "delimited", "Entities", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/lessphp/Parser.php#L2384-L2404
220,402
moodle/moodle
lib/lessphp/Parser.php
Less_Parser.ArgString
public static function ArgString($arg){ $type = gettype($arg); if( $type === 'object'){ $string = $arg->cache_string; unset($arg->cache_string); return $string; }elseif( $type === 'array' ){ $string = ' Array('; foreach($arg as $k => $a){ $string .= var_export($k,true).' => '.self::ArgString...
php
public static function ArgString($arg){ $type = gettype($arg); if( $type === 'object'){ $string = $arg->cache_string; unset($arg->cache_string); return $string; }elseif( $type === 'array' ){ $string = ' Array('; foreach($arg as $k => $a){ $string .= var_export($k,true).' => '.self::ArgString...
[ "public", "static", "function", "ArgString", "(", "$", "arg", ")", "{", "$", "type", "=", "gettype", "(", "$", "arg", ")", ";", "if", "(", "$", "type", "===", "'object'", ")", "{", "$", "string", "=", "$", "arg", "->", "cache_string", ";", "unset",...
Convert an argument to a string for use in the parser cache @return string
[ "Convert", "an", "argument", "to", "a", "string", "for", "use", "in", "the", "parser", "cache" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/lessphp/Parser.php#L2595-L2613
220,403
moodle/moodle
lib/classes/text.php
core_text.typo3
protected static function typo3($reset = false) { static $typo3cs = null; if ($reset) { $typo3cs = null; return null; } if (isset($typo3cs)) { return $typo3cs; } global $CFG; // Required files require_once($CFG->libd...
php
protected static function typo3($reset = false) { static $typo3cs = null; if ($reset) { $typo3cs = null; return null; } if (isset($typo3cs)) { return $typo3cs; } global $CFG; // Required files require_once($CFG->libd...
[ "protected", "static", "function", "typo3", "(", "$", "reset", "=", "false", ")", "{", "static", "$", "typo3cs", "=", "null", ";", "if", "(", "$", "reset", ")", "{", "$", "typo3cs", "=", "null", ";", "return", "null", ";", "}", "if", "(", "isset", ...
Return t3lib helper class, which is used for conversion between charsets @param bool $reset @return t3lib_cs
[ "Return", "t3lib", "helper", "class", "which", "is", "used", "for", "conversion", "between", "charsets" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/text.php#L62-L111
220,404
moodle/moodle
lib/classes/text.php
core_text.parse_charset
public static function parse_charset($charset) { $charset = strtolower($charset); // shortcuts so that we do not have to load typo3 on every page if ($charset === 'utf8' or $charset === 'utf-8') { return 'utf-8'; } if (preg_match('/^(cp|win|windows)-?(12[0-9]{2})$/...
php
public static function parse_charset($charset) { $charset = strtolower($charset); // shortcuts so that we do not have to load typo3 on every page if ($charset === 'utf8' or $charset === 'utf-8') { return 'utf-8'; } if (preg_match('/^(cp|win|windows)-?(12[0-9]{2})$/...
[ "public", "static", "function", "parse_charset", "(", "$", "charset", ")", "{", "$", "charset", "=", "strtolower", "(", "$", "charset", ")", ";", "// shortcuts so that we do not have to load typo3 on every page", "if", "(", "$", "charset", "===", "'utf8'", "or", "...
Standardise charset name Please note it does not mean the returned charset is actually supported. @static @param string $charset raw charset name @return string normalised lowercase charset name
[ "Standardise", "charset", "name" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/text.php#L130-L165
220,405
moodle/moodle
lib/classes/text.php
core_text.str_max_bytes
public static function str_max_bytes($string, $bytes) { if (function_exists('mb_strcut')) { return mb_strcut($string, 0, $bytes, 'UTF-8'); } $oldlevel = error_reporting(E_PARSE); $result = self::typo3()->strtrunc('utf-8', $string, $bytes); error_reporting($oldlevel);...
php
public static function str_max_bytes($string, $bytes) { if (function_exists('mb_strcut')) { return mb_strcut($string, 0, $bytes, 'UTF-8'); } $oldlevel = error_reporting(E_PARSE); $result = self::typo3()->strtrunc('utf-8', $string, $bytes); error_reporting($oldlevel);...
[ "public", "static", "function", "str_max_bytes", "(", "$", "string", ",", "$", "bytes", ")", "{", "if", "(", "function_exists", "(", "'mb_strcut'", ")", ")", "{", "return", "mb_strcut", "(", "$", "string", ",", "0", ",", "$", "bytes", ",", "'UTF-8'", "...
Truncates a string to no more than a certain number of bytes in a multi-byte safe manner. UTF-8 only! Many of the other charsets we test for (like ISO-2022-JP and EUC-JP) are not supported by typo3, and will give invalid results, so we are supporting UTF-8 only. @param string $string String to truncate @param int $by...
[ "Truncates", "a", "string", "to", "no", "more", "than", "a", "certain", "number", "of", "bytes", "in", "a", "multi", "-", "byte", "safe", "manner", ".", "UTF", "-", "8", "only!" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/text.php#L268-L278
220,406
moodle/moodle
lib/classes/text.php
core_text.specialtoascii
public static function specialtoascii($text, $charset='utf-8') { $charset = self::parse_charset($charset); $oldlevel = error_reporting(E_PARSE); $result = self::typo3()->specCharsToASCII($charset, (string)$text); error_reporting($oldlevel); return $result; }
php
public static function specialtoascii($text, $charset='utf-8') { $charset = self::parse_charset($charset); $oldlevel = error_reporting(E_PARSE); $result = self::typo3()->specCharsToASCII($charset, (string)$text); error_reporting($oldlevel); return $result; }
[ "public", "static", "function", "specialtoascii", "(", "$", "text", ",", "$", "charset", "=", "'utf-8'", ")", "{", "$", "charset", "=", "self", "::", "parse_charset", "(", "$", "charset", ")", ";", "$", "oldlevel", "=", "error_reporting", "(", "E_PARSE", ...
Try to convert upper unicode characters to plain ascii, the returned string may contain unconverted unicode characters. @param string $text input string @param string $charset encoding of the text @return string converted ascii string
[ "Try", "to", "convert", "upper", "unicode", "characters", "to", "plain", "ascii", "the", "returned", "string", "may", "contain", "unconverted", "unicode", "characters", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/text.php#L430-L436
220,407
moodle/moodle
lib/classes/text.php
core_text.get_entities_table
protected static function get_entities_table() { static $trans_tbl = null; // Generate/create $trans_tbl if (!isset($trans_tbl)) { if (version_compare(phpversion(), '5.3.4') < 0) { $trans_tbl = array(); foreach (get_html_translation_table(HTML_ENTITIE...
php
protected static function get_entities_table() { static $trans_tbl = null; // Generate/create $trans_tbl if (!isset($trans_tbl)) { if (version_compare(phpversion(), '5.3.4') < 0) { $trans_tbl = array(); foreach (get_html_translation_table(HTML_ENTITIE...
[ "protected", "static", "function", "get_entities_table", "(", ")", "{", "static", "$", "trans_tbl", "=", "null", ";", "// Generate/create $trans_tbl", "if", "(", "!", "isset", "(", "$", "trans_tbl", ")", ")", "{", "if", "(", "version_compare", "(", "phpversion...
Returns HTML entity transliteration table. @return array with (html entity => utf-8) elements
[ "Returns", "HTML", "entity", "transliteration", "table", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/text.php#L529-L551
220,408
moodle/moodle
lib/classes/text.php
core_text.get_encodings
public static function get_encodings() { $encodings = array(); $encodings['UTF-8'] = 'UTF-8'; $winenc = strtoupper(get_string('localewincharset', 'langconfig')); if ($winenc != '') { $encodings[$winenc] = $winenc; } $nixenc = strtoupper(get_string('oldcharset'...
php
public static function get_encodings() { $encodings = array(); $encodings['UTF-8'] = 'UTF-8'; $winenc = strtoupper(get_string('localewincharset', 'langconfig')); if ($winenc != '') { $encodings[$winenc] = $winenc; } $nixenc = strtoupper(get_string('oldcharset'...
[ "public", "static", "function", "get_encodings", "(", ")", "{", "$", "encodings", "=", "array", "(", ")", ";", "$", "encodings", "[", "'UTF-8'", "]", "=", "'UTF-8'", ";", "$", "winenc", "=", "strtoupper", "(", "get_string", "(", "'localewincharset'", ",", ...
Returns encoding options for select boxes, utf-8 and platform encoding first @return array encodings
[ "Returns", "encoding", "options", "for", "select", "boxes", "utf", "-", "8", "and", "platform", "encoding", "first" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/text.php#L674-L689
220,409
moodle/moodle
lib/classes/text.php
core_text.utf8ord
public static function utf8ord($utf8char) { if ($utf8char == '') { return 0; } $ord0 = ord($utf8char{0}); if ($ord0 >= 0 && $ord0 <= 127) { return $ord0; } $ord1 = ord($utf8char{1}); if ($ord0 >= 192 && $ord0 <= 223) { return ($...
php
public static function utf8ord($utf8char) { if ($utf8char == '') { return 0; } $ord0 = ord($utf8char{0}); if ($ord0 >= 0 && $ord0 <= 127) { return $ord0; } $ord1 = ord($utf8char{1}); if ($ord0 >= 192 && $ord0 <= 223) { return ($...
[ "public", "static", "function", "utf8ord", "(", "$", "utf8char", ")", "{", "if", "(", "$", "utf8char", "==", "''", ")", "{", "return", "0", ";", "}", "$", "ord0", "=", "ord", "(", "$", "utf8char", "{", "0", "}", ")", ";", "if", "(", "$", "ord0"...
Returns the code of the given UTF-8 character @param string $utf8char one UTF-8 character @return int the code of the given character
[ "Returns", "the", "code", "of", "the", "given", "UTF", "-", "8", "character" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/text.php#L720-L741
220,410
moodle/moodle
lib/classes/text.php
core_text.strtotitle
public static function strtotitle($text) { if (empty($text)) { return $text; } if (function_exists('mb_convert_case')) { return mb_convert_case($text, MB_CASE_TITLE, 'UTF-8'); } $text = self::strtolower($text); $words = explode(' ', $text); ...
php
public static function strtotitle($text) { if (empty($text)) { return $text; } if (function_exists('mb_convert_case')) { return mb_convert_case($text, MB_CASE_TITLE, 'UTF-8'); } $text = self::strtolower($text); $words = explode(' ', $text); ...
[ "public", "static", "function", "strtotitle", "(", "$", "text", ")", "{", "if", "(", "empty", "(", "$", "text", ")", ")", "{", "return", "$", "text", ";", "}", "if", "(", "function_exists", "(", "'mb_convert_case'", ")", ")", "{", "return", "mb_convert...
Makes first letter of each word capital - words must be separated by spaces. Use with care, this function does not work properly in many locales!!! @param string $text input string @return string
[ "Makes", "first", "letter", "of", "each", "word", "capital", "-", "words", "must", "be", "separated", "by", "spaces", ".", "Use", "with", "care", "this", "function", "does", "not", "work", "properly", "in", "many", "locales!!!" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/text.php#L750-L777
220,411
moodle/moodle
lib/grade/grade_item.php
grade_item.qualifies_for_regrading
public function qualifies_for_regrading() { if (empty($this->id)) { return false; } $db_item = new grade_item(array('id' => $this->id)); $calculationdiff = $db_item->calculation != $this->calculation; $categorydiff = $db_item->categoryid != $this->categoryid; ...
php
public function qualifies_for_regrading() { if (empty($this->id)) { return false; } $db_item = new grade_item(array('id' => $this->id)); $calculationdiff = $db_item->calculation != $this->calculation; $categorydiff = $db_item->categoryid != $this->categoryid; ...
[ "public", "function", "qualifies_for_regrading", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "id", ")", ")", "{", "return", "false", ";", "}", "$", "db_item", "=", "new", "grade_item", "(", "array", "(", "'id'", "=>", "$", "this", "->"...
Compares the values held by this object with those of the matching record in DB, and returns whether or not these differences are sufficient to justify an update of all parent objects. This assumes that this object has an id number and a matching record in DB. If not, it will return false. @return bool
[ "Compares", "the", "values", "held", "by", "this", "object", "with", "those", "of", "the", "matching", "record", "in", "DB", "and", "returns", "whether", "or", "not", "these", "differences", "are", "sufficient", "to", "justify", "an", "update", "of", "all", ...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L317-L344
220,412
moodle/moodle
lib/grade/grade_item.php
grade_item.delete_all_grades
public function delete_all_grades($source=null) { if (!$this->is_course_item()) { $this->force_regrading(); } if ($grades = grade_grade::fetch_all(array('itemid'=>$this->id))) { foreach ($grades as $grade) { $grade->delete($source); } ...
php
public function delete_all_grades($source=null) { if (!$this->is_course_item()) { $this->force_regrading(); } if ($grades = grade_grade::fetch_all(array('itemid'=>$this->id))) { foreach ($grades as $grade) { $grade->delete($source); } ...
[ "public", "function", "delete_all_grades", "(", "$", "source", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "is_course_item", "(", ")", ")", "{", "$", "this", "->", "force_regrading", "(", ")", ";", "}", "if", "(", "$", "grades", "=", ...
Delete all grades @param string $source from where was the object deleted (mod/forum, manual, etc.) @return bool
[ "Delete", "all", "grades" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L413-L432
220,413
moodle/moodle
lib/grade/grade_item.php
grade_item.add_idnumber
public function add_idnumber($idnumber) { global $DB; if (!empty($this->idnumber)) { return false; } if ($this->itemtype == 'mod' and !$this->is_outcome_item()) { if ($this->itemnumber == 0) { // for activity modules, itemnumber 0 is synced with t...
php
public function add_idnumber($idnumber) { global $DB; if (!empty($this->idnumber)) { return false; } if ($this->itemtype == 'mod' and !$this->is_outcome_item()) { if ($this->itemnumber == 0) { // for activity modules, itemnumber 0 is synced with t...
[ "public", "function", "add_idnumber", "(", "$", "idnumber", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "idnumber", ")", ")", "{", "return", "false", ";", "}", "if", "(", "$", "this", "->", "itemtype", "==",...
Set idnumber of grade item, updates also course_modules table @param string $idnumber (without magic quotes) @return bool success
[ "Set", "idnumber", "of", "grade", "item", "updates", "also", "course_modules", "table" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L496-L523
220,414
moodle/moodle
lib/grade/grade_item.php
grade_item.set_hidden
public function set_hidden($hidden, $cascade=false) { parent::set_hidden($hidden, $cascade); if ($cascade) { if ($grades = grade_grade::fetch_all(array('itemid'=>$this->id))) { foreach($grades as $grade) { $grade->grade_item =& $this; ...
php
public function set_hidden($hidden, $cascade=false) { parent::set_hidden($hidden, $cascade); if ($cascade) { if ($grades = grade_grade::fetch_all(array('itemid'=>$this->id))) { foreach($grades as $grade) { $grade->grade_item =& $this; ...
[ "public", "function", "set_hidden", "(", "$", "hidden", ",", "$", "cascade", "=", "false", ")", "{", "parent", "::", "set_hidden", "(", "$", "hidden", ",", "$", "cascade", ")", ";", "if", "(", "$", "cascade", ")", "{", "if", "(", "$", "grades", "="...
Set the hidden status of grade_item and all grades. 0 mean always visible, 1 means always hidden and a number > 1 is a timestamp to hide until @param int $hidden new hidden status @param bool $cascade apply to child objects too
[ "Set", "the", "hidden", "status", "of", "grade_item", "and", "all", "grades", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L655-L678
220,415
moodle/moodle
lib/grade/grade_item.php
grade_item.has_hidden_grades
public function has_hidden_grades($groupsql="", array $params=null, $groupwheresql="") { global $DB; $params = (array)$params; $params['itemid'] = $this->id; return $DB->get_field_sql("SELECT COUNT(*) FROM {grade_grades} g LEFT JOIN " ."{user} u ON g.userid =...
php
public function has_hidden_grades($groupsql="", array $params=null, $groupwheresql="") { global $DB; $params = (array)$params; $params['itemid'] = $this->id; return $DB->get_field_sql("SELECT COUNT(*) FROM {grade_grades} g LEFT JOIN " ."{user} u ON g.userid =...
[ "public", "function", "has_hidden_grades", "(", "$", "groupsql", "=", "\"\"", ",", "array", "$", "params", "=", "null", ",", "$", "groupwheresql", "=", "\"\"", ")", "{", "global", "$", "DB", ";", "$", "params", "=", "(", "array", ")", "$", "params", ...
Returns the number of grades that are hidden @param string $groupsql SQL to limit the query by group @param array $params SQL params for $groupsql @param string $groupwheresql Where conditions for $groupsql @return int The number of hidden grades
[ "Returns", "the", "number", "of", "grades", "that", "are", "hidden" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L688-L695
220,416
moodle/moodle
lib/grade/grade_item.php
grade_item.regrade_final_grades
public function regrade_final_grades($userid=null) { global $CFG, $DB; // locked grade items already have correct final grades if ($this->is_locked()) { return true; } // calculation produces final value using formula from other final values if ($this->is_ca...
php
public function regrade_final_grades($userid=null) { global $CFG, $DB; // locked grade items already have correct final grades if ($this->is_locked()) { return true; } // calculation produces final value using formula from other final values if ($this->is_ca...
[ "public", "function", "regrade_final_grades", "(", "$", "userid", "=", "null", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "// locked grade items already have correct final grades", "if", "(", "$", "this", "->", "is_locked", "(", ")", ")", "{", "retur...
Performs the necessary calculations on the grades_final referenced by this grade_item. Also resets the needsupdate flag once successfully performed. This function must be used ONLY from lib/gradeslib.php/grade_regrade_final_grades(), because the regrading must be done in correct order!! @param int $userid Supply a us...
[ "Performs", "the", "necessary", "calculations", "on", "the", "grades_final", "referenced", "by", "this", "grade_item", ".", "Also", "resets", "the", "needsupdate", "flag", "once", "successfully", "performed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L718-L795
220,417
moodle/moodle
lib/grade/grade_item.php
grade_item.adjust_raw_grade
public function adjust_raw_grade($rawgrade, $rawmin, $rawmax) { if (is_null($rawgrade)) { return null; } if ($this->gradetype == GRADE_TYPE_VALUE) { // Dealing with numerical grade if ($this->grademax < $this->grademin) { return null; } ...
php
public function adjust_raw_grade($rawgrade, $rawmin, $rawmax) { if (is_null($rawgrade)) { return null; } if ($this->gradetype == GRADE_TYPE_VALUE) { // Dealing with numerical grade if ($this->grademax < $this->grademin) { return null; } ...
[ "public", "function", "adjust_raw_grade", "(", "$", "rawgrade", ",", "$", "rawmin", ",", "$", "rawmax", ")", "{", "if", "(", "is_null", "(", "$", "rawgrade", ")", ")", "{", "return", "null", ";", "}", "if", "(", "$", "this", "->", "gradetype", "==", ...
Given a float grade value or integer grade scale, applies a number of adjustment based on grade_item variables and returns the result. @param float $rawgrade The raw grade value @param float $rawmin original rawmin @param float $rawmax original rawmax @return mixed
[ "Given", "a", "float", "grade", "value", "or", "integer", "grade", "scale", "applies", "a", "number", "of", "adjustment", "based", "on", "grade_item", "variables", "and", "returns", "the", "result", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L806-L866
220,418
moodle/moodle
lib/grade/grade_item.php
grade_item.rescale_grades_keep_percentage
public function rescale_grades_keep_percentage($oldgrademin, $oldgrademax, $newgrademin, $newgrademax, $source = null) { global $DB; if (empty($this->id)) { return false; } if ($oldgrademax <= $oldgrademin) { // Grades cannot be scaled. return false;...
php
public function rescale_grades_keep_percentage($oldgrademin, $oldgrademax, $newgrademin, $newgrademax, $source = null) { global $DB; if (empty($this->id)) { return false; } if ($oldgrademax <= $oldgrademin) { // Grades cannot be scaled. return false;...
[ "public", "function", "rescale_grades_keep_percentage", "(", "$", "oldgrademin", ",", "$", "oldgrademax", ",", "$", "newgrademin", ",", "$", "newgrademax", ",", "$", "source", "=", "null", ")", "{", "global", "$", "DB", ";", "if", "(", "empty", "(", "$", ...
Update the rawgrademax and rawgrademin for all grade_grades records for this item. Scale every rawgrade to maintain the percentage. This function should be called after the gradeitem has been updated to the new min and max values. @param float $oldgrademin The previous grade min value @param float $oldgrademax The pre...
[ "Update", "the", "rawgrademax", "and", "rawgrademin", "for", "all", "grade_grades", "records", "for", "this", "item", ".", "Scale", "every", "rawgrade", "to", "maintain", "the", "percentage", ".", "This", "function", "should", "be", "called", "after", "the", "...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L880-L922
220,419
moodle/moodle
lib/grade/grade_item.php
grade_item.force_regrading
public function force_regrading() { global $DB; $this->needsupdate = 1; //mark this item and course item only - categories and calculated items are always regraded $wheresql = "(itemtype='course' OR id=?) AND courseid=?"; $params = array($this->id, $this->courseid); $DB...
php
public function force_regrading() { global $DB; $this->needsupdate = 1; //mark this item and course item only - categories and calculated items are always regraded $wheresql = "(itemtype='course' OR id=?) AND courseid=?"; $params = array($this->id, $this->courseid); $DB...
[ "public", "function", "force_regrading", "(", ")", "{", "global", "$", "DB", ";", "$", "this", "->", "needsupdate", "=", "1", ";", "//mark this item and course item only - categories and calculated items are always regraded", "$", "wheresql", "=", "\"(itemtype='course' OR i...
Sets this grade_item's needsupdate to true. Also marks the course item as needing update. @return void
[ "Sets", "this", "grade_item", "s", "needsupdate", "to", "true", ".", "Also", "marks", "the", "course", "item", "as", "needing", "update", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L929-L936
220,420
moodle/moodle
lib/grade/grade_item.php
grade_item.load_scale
public function load_scale() { if ($this->gradetype != GRADE_TYPE_SCALE) { $this->scaleid = null; } if (!empty($this->scaleid)) { //do not load scale if already present if (empty($this->scale->id) or $this->scale->id != $this->scaleid) { $this...
php
public function load_scale() { if ($this->gradetype != GRADE_TYPE_SCALE) { $this->scaleid = null; } if (!empty($this->scaleid)) { //do not load scale if already present if (empty($this->scale->id) or $this->scale->id != $this->scaleid) { $this...
[ "public", "function", "load_scale", "(", ")", "{", "if", "(", "$", "this", "->", "gradetype", "!=", "GRADE_TYPE_SCALE", ")", "{", "$", "this", "->", "scaleid", "=", "null", ";", "}", "if", "(", "!", "empty", "(", "$", "this", "->", "scaleid", ")", ...
Instantiates a grade_scale object from the DB if this item's scaleid variable is set @return grade_scale Returns a grade_scale object or null if no scale used
[ "Instantiates", "a", "grade_scale", "object", "from", "the", "DB", "if", "this", "item", "s", "scaleid", "variable", "is", "set" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L943-L970
220,421
moodle/moodle
lib/grade/grade_item.php
grade_item.load_outcome
public function load_outcome() { if (!empty($this->outcomeid)) { $this->outcome = grade_outcome::fetch(array('id'=>$this->outcomeid)); } return $this->outcome; }
php
public function load_outcome() { if (!empty($this->outcomeid)) { $this->outcome = grade_outcome::fetch(array('id'=>$this->outcomeid)); } return $this->outcome; }
[ "public", "function", "load_outcome", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "outcomeid", ")", ")", "{", "$", "this", "->", "outcome", "=", "grade_outcome", "::", "fetch", "(", "array", "(", "'id'", "=>", "$", "this", "->", ...
Instantiates a grade_outcome object from the DB if this item's outcomeid variable is set @return grade_outcome This grade item's associated grade_outcome or null
[ "Instantiates", "a", "grade_outcome", "object", "from", "the", "DB", "if", "this", "item", "s", "outcomeid", "variable", "is", "set" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L977-L982
220,422
moodle/moodle
lib/grade/grade_item.php
grade_item.get_item_category
public function get_item_category() { if (!$this->is_course_item() and !$this->is_category_item()) { return false; } return grade_category::fetch(array('id'=>$this->iteminstance)); }
php
public function get_item_category() { if (!$this->is_course_item() and !$this->is_category_item()) { return false; } return grade_category::fetch(array('id'=>$this->iteminstance)); }
[ "public", "function", "get_item_category", "(", ")", "{", "if", "(", "!", "$", "this", "->", "is_course_item", "(", ")", "and", "!", "$", "this", "->", "is_category_item", "(", ")", ")", "{", "return", "false", ";", "}", "return", "grade_category", "::",...
Returns the grade_category for a grade category grade item @return grade_category|bool Returns a grade_category instance if applicable or false otherwise
[ "Returns", "the", "grade_category", "for", "a", "grade", "category", "grade", "item" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1017-L1022
220,423
moodle/moodle
lib/grade/grade_item.php
grade_item.is_overridable_item
public function is_overridable_item() { if ($this->is_course_item() or $this->is_category_item()) { $overridable = (bool) get_config('moodle', 'grade_overridecat'); } else { $overridable = false; } return !$this->is_outcome_item() and ($this->is_external_item() o...
php
public function is_overridable_item() { if ($this->is_course_item() or $this->is_category_item()) { $overridable = (bool) get_config('moodle', 'grade_overridecat'); } else { $overridable = false; } return !$this->is_outcome_item() and ($this->is_external_item() o...
[ "public", "function", "is_overridable_item", "(", ")", "{", "if", "(", "$", "this", "->", "is_course_item", "(", ")", "or", "$", "this", "->", "is_category_item", "(", ")", ")", "{", "$", "overridable", "=", "(", "bool", ")", "get_config", "(", "'moodle'...
Is the grade item overridable @return bool
[ "Is", "the", "grade", "item", "overridable" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1087-L1095
220,424
moodle/moodle
lib/grade/grade_item.php
grade_item.fetch_course_item
public static function fetch_course_item($courseid) { if ($course_item = grade_item::fetch(array('courseid'=>$courseid, 'itemtype'=>'course'))) { return $course_item; } // first get category - it creates the associated grade item $course_category = grade_category::fetch_cour...
php
public static function fetch_course_item($courseid) { if ($course_item = grade_item::fetch(array('courseid'=>$courseid, 'itemtype'=>'course'))) { return $course_item; } // first get category - it creates the associated grade item $course_category = grade_category::fetch_cour...
[ "public", "static", "function", "fetch_course_item", "(", "$", "courseid", ")", "{", "if", "(", "$", "course_item", "=", "grade_item", "::", "fetch", "(", "array", "(", "'courseid'", "=>", "$", "courseid", ",", "'itemtype'", "=>", "'course'", ")", ")", ")"...
Returns the grade item associated with the course @param int $courseid @return grade_item Course level grade item object
[ "Returns", "the", "grade", "item", "associated", "with", "the", "course" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1131-L1139
220,425
moodle/moodle
lib/grade/grade_item.php
grade_item.is_calculated
public function is_calculated() { if (empty($this->calculation)) { return false; } /* * The main reason why we use the ##gixxx## instead of [[idnumber]] is speed of depends_on(), * we would have to fetch all course grade items to find out the ids. * Also i...
php
public function is_calculated() { if (empty($this->calculation)) { return false; } /* * The main reason why we use the ##gixxx## instead of [[idnumber]] is speed of depends_on(), * we would have to fetch all course grade items to find out the ids. * Also i...
[ "public", "function", "is_calculated", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "calculation", ")", ")", "{", "return", "false", ";", "}", "/*\n * The main reason why we use the ##gixxx## instead of [[idnumber]] is speed of depends_on(),\n ...
Checks if grade calculated. Returns this object's calculation. @return bool true if grade item calculated.
[ "Checks", "if", "grade", "calculated", ".", "Returns", "this", "object", "s", "calculation", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1155-L1172
220,426
moodle/moodle
lib/grade/grade_item.php
grade_item.get_calculation
public function get_calculation() { if ($this->is_calculated()) { return grade_item::denormalize_formula($this->calculation, $this->courseid); } else { return NULL; } }
php
public function get_calculation() { if ($this->is_calculated()) { return grade_item::denormalize_formula($this->calculation, $this->courseid); } else { return NULL; } }
[ "public", "function", "get_calculation", "(", ")", "{", "if", "(", "$", "this", "->", "is_calculated", "(", ")", ")", "{", "return", "grade_item", "::", "denormalize_formula", "(", "$", "this", "->", "calculation", ",", "$", "this", "->", "courseid", ")", ...
Returns calculation string if grade calculated. @return string Returns the grade item's calculation if calculation is used, null if not
[ "Returns", "calculation", "string", "if", "grade", "calculated", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1179-L1186
220,427
moodle/moodle
lib/grade/grade_item.php
grade_item.set_sortorder
public function set_sortorder($sortorder) { if ($this->sortorder == $sortorder) { return; } $this->sortorder = $sortorder; $this->update(); }
php
public function set_sortorder($sortorder) { if ($this->sortorder == $sortorder) { return; } $this->sortorder = $sortorder; $this->update(); }
[ "public", "function", "set_sortorder", "(", "$", "sortorder", ")", "{", "if", "(", "$", "this", "->", "sortorder", "==", "$", "sortorder", ")", "{", "return", ";", "}", "$", "this", "->", "sortorder", "=", "$", "sortorder", ";", "$", "this", "->", "u...
Sets the sortorder of this grade_item. This method is also available in grade_category, for cases where the object type is not know. @param int $sortorder
[ "Sets", "the", "sortorder", "of", "this", "grade_item", ".", "This", "method", "is", "also", "available", "in", "grade_category", "for", "cases", "where", "the", "object", "type", "is", "not", "know", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1338-L1344
220,428
moodle/moodle
lib/grade/grade_item.php
grade_item.get_name
public function get_name($fulltotal=false) { global $CFG; require_once($CFG->dirroot . '/course/lib.php'); if (strval($this->itemname) !== '') { // MDL-10557 // Make it obvious to users if the course module to which this grade item relates, is currently being removed. ...
php
public function get_name($fulltotal=false) { global $CFG; require_once($CFG->dirroot . '/course/lib.php'); if (strval($this->itemname) !== '') { // MDL-10557 // Make it obvious to users if the course module to which this grade item relates, is currently being removed. ...
[ "public", "function", "get_name", "(", "$", "fulltotal", "=", "false", ")", "{", "global", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/course/lib.php'", ")", ";", "if", "(", "strval", "(", "$", "this", "->", "itemname", "...
Returns the most descriptive field for this object. Determines what type of grade item it is then returns the appropriate string @param bool $fulltotal If the item is a category total, returns $categoryname."total" instead of "Category total" or "Course total" @return string name
[ "Returns", "the", "most", "descriptive", "field", "for", "this", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1408-L1439
220,429
moodle/moodle
lib/grade/grade_item.php
grade_item.set_parent
public function set_parent($parentid, $updateaggregationfields = true) { if ($this->is_course_item() or $this->is_category_item()) { print_error('cannotsetparentforcatoritem'); } if ($this->categoryid == $parentid) { return true; } // find parent and che...
php
public function set_parent($parentid, $updateaggregationfields = true) { if ($this->is_course_item() or $this->is_category_item()) { print_error('cannotsetparentforcatoritem'); } if ($this->categoryid == $parentid) { return true; } // find parent and che...
[ "public", "function", "set_parent", "(", "$", "parentid", ",", "$", "updateaggregationfields", "=", "true", ")", "{", "if", "(", "$", "this", "->", "is_course_item", "(", ")", "or", "$", "this", "->", "is_category_item", "(", ")", ")", "{", "print_error", ...
Sets this item's categoryid. A generic method shared by objects that have a parent id of some kind. @param int $parentid The ID of the new parent @param bool $updateaggregationfields Whether or not to convert the aggregation fields when switching between category. Set this to false when the aggregation fields have bee...
[ "Sets", "this", "item", "s", "categoryid", ".", "A", "generic", "method", "shared", "by", "objects", "that", "have", "a", "parent", "id", "of", "some", "kind", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1463-L1490
220,430
moodle/moodle
lib/grade/grade_item.php
grade_item.set_aggregation_fields_for_aggregation
public function set_aggregation_fields_for_aggregation($from, $to) { $defaults = grade_category::get_default_aggregation_coefficient_values($to); $origaggregationcoef = $this->aggregationcoef; $origaggregationcoef2 = $this->aggregationcoef2; $origweighoverride = $this->weightoverride; ...
php
public function set_aggregation_fields_for_aggregation($from, $to) { $defaults = grade_category::get_default_aggregation_coefficient_values($to); $origaggregationcoef = $this->aggregationcoef; $origaggregationcoef2 = $this->aggregationcoef2; $origweighoverride = $this->weightoverride; ...
[ "public", "function", "set_aggregation_fields_for_aggregation", "(", "$", "from", ",", "$", "to", ")", "{", "$", "defaults", "=", "grade_category", "::", "get_default_aggregation_coefficient_values", "(", "$", "to", ")", ";", "$", "origaggregationcoef", "=", "$", ...
Update the aggregation fields when the aggregation changed. This method should always be called when the aggregation has changed, but also when the item was moved to another category, even it if uses the same aggregation method. Some values such as the weight only make sense within a category, once moved the values s...
[ "Update", "the", "aggregation", "fields", "when", "the", "aggregation", "changed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1508-L1545
220,431
moodle/moodle
lib/grade/grade_item.php
grade_item.bounded_grade
public function bounded_grade($gradevalue) { global $CFG; if (is_null($gradevalue)) { return null; } if ($this->gradetype == GRADE_TYPE_SCALE) { // no >100% grades hack for scale grades! // 1.5 is rounded to 2 ;-) return (int)bounded_numb...
php
public function bounded_grade($gradevalue) { global $CFG; if (is_null($gradevalue)) { return null; } if ($this->gradetype == GRADE_TYPE_SCALE) { // no >100% grades hack for scale grades! // 1.5 is rounded to 2 ;-) return (int)bounded_numb...
[ "public", "function", "bounded_grade", "(", "$", "gradevalue", ")", "{", "global", "$", "CFG", ";", "if", "(", "is_null", "(", "$", "gradevalue", ")", ")", "{", "return", "null", ";", "}", "if", "(", "$", "this", "->", "gradetype", "==", "GRADE_TYPE_SC...
Makes sure value is a valid grade value. @param float $gradevalue @return mixed float or int fixed grade value
[ "Makes", "sure", "value", "is", "a", "valid", "grade", "value", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1553-L1583
220,432
moodle/moodle
lib/grade/grade_item.php
grade_item.depends_on
public function depends_on($reset_cache=false) { global $CFG, $DB; if ($reset_cache) { $this->dependson_cache = null; } else if (isset($this->dependson_cache)) { return $this->dependson_cache; } if ($this->is_locked()) { // locked items do no...
php
public function depends_on($reset_cache=false) { global $CFG, $DB; if ($reset_cache) { $this->dependson_cache = null; } else if (isset($this->dependson_cache)) { return $this->dependson_cache; } if ($this->is_locked()) { // locked items do no...
[ "public", "function", "depends_on", "(", "$", "reset_cache", "=", "false", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "if", "(", "$", "reset_cache", ")", "{", "$", "this", "->", "dependson_cache", "=", "null", ";", "}", "else", "if", "(", ...
Finds out on which other items does this depend directly when doing calculation or category aggregation @param bool $reset_cache @return array of grade_item IDs this one depends on
[ "Finds", "out", "on", "which", "other", "items", "does", "this", "depend", "directly", "when", "doing", "calculation", "or", "category", "aggregation" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1591-L1679
220,433
moodle/moodle
lib/grade/grade_item.php
grade_item.refresh_grades
public function refresh_grades($userid=0) { global $DB; if ($this->itemtype == 'mod') { if ($this->is_outcome_item()) { //nothing to do return true; } if (!$activity = $DB->get_record($this->itemmodule, array('id' => $this->iteminstanc...
php
public function refresh_grades($userid=0) { global $DB; if ($this->itemtype == 'mod') { if ($this->is_outcome_item()) { //nothing to do return true; } if (!$activity = $DB->get_record($this->itemmodule, array('id' => $this->iteminstanc...
[ "public", "function", "refresh_grades", "(", "$", "userid", "=", "0", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "this", "->", "itemtype", "==", "'mod'", ")", "{", "if", "(", "$", "this", "->", "is_outcome_item", "(", ")", ")", "{", "//not...
Refetch grades from modules, plugins. @param int $userid optional, limit the refetch to a single user @return bool Returns true on success or if there is nothing to do
[ "Refetch", "grades", "from", "modules", "plugins", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L1687-L1712
220,434
moodle/moodle
lib/grade/grade_item.php
grade_item.validate_formula
public function validate_formula($formulastr) { global $CFG, $DB; require_once($CFG->libdir.'/mathslib.php'); $formulastr = grade_item::normalize_formula($formulastr, $this->courseid); if (empty($formulastr)) { return true; } if (strpos($formulastr, '=') !=...
php
public function validate_formula($formulastr) { global $CFG, $DB; require_once($CFG->libdir.'/mathslib.php'); $formulastr = grade_item::normalize_formula($formulastr, $this->courseid); if (empty($formulastr)) { return true; } if (strpos($formulastr, '=') !=...
[ "public", "function", "validate_formula", "(", "$", "formulastr", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "require_once", "(", "$", "CFG", "->", "libdir", ".", "'/mathslib.php'", ")", ";", "$", "formulastr", "=", "grade_item", "::", "normalize...
Validate the formula. @param string $formulastr @return bool true if calculation possible, false otherwise
[ "Validate", "the", "formula", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L2293-L2364
220,435
moodle/moodle
lib/grade/grade_item.php
grade_item.get_displaytype
public function get_displaytype() { global $CFG; if ($this->display == GRADE_DISPLAY_TYPE_DEFAULT) { return grade_get_setting($this->courseid, 'displaytype', $CFG->grade_displaytype); } else { return $this->display; } }
php
public function get_displaytype() { global $CFG; if ($this->display == GRADE_DISPLAY_TYPE_DEFAULT) { return grade_get_setting($this->courseid, 'displaytype', $CFG->grade_displaytype); } else { return $this->display; } }
[ "public", "function", "get_displaytype", "(", ")", "{", "global", "$", "CFG", ";", "if", "(", "$", "this", "->", "display", "==", "GRADE_DISPLAY_TYPE_DEFAULT", ")", "{", "return", "grade_get_setting", "(", "$", "this", "->", "courseid", ",", "'displaytype'", ...
Returns the value of the display type It can be set at 3 levels: grade_item, course setting and site. The lowest level overrides the higher ones. @return int Display type
[ "Returns", "the", "value", "of", "the", "display", "type" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L2373-L2382
220,436
moodle/moodle
lib/grade/grade_item.php
grade_item.get_decimals
public function get_decimals() { global $CFG; if (is_null($this->decimals)) { return grade_get_setting($this->courseid, 'decimalpoints', $CFG->grade_decimalpoints); } else { return $this->decimals; } }
php
public function get_decimals() { global $CFG; if (is_null($this->decimals)) { return grade_get_setting($this->courseid, 'decimalpoints', $CFG->grade_decimalpoints); } else { return $this->decimals; } }
[ "public", "function", "get_decimals", "(", ")", "{", "global", "$", "CFG", ";", "if", "(", "is_null", "(", "$", "this", "->", "decimals", ")", ")", "{", "return", "grade_get_setting", "(", "$", "this", "->", "courseid", ",", "'decimalpoints'", ",", "$", ...
Returns the value of the decimals field It can be set at 3 levels: grade_item, course setting and site. The lowest level overrides the higher ones. @return int Decimals (0 - 5)
[ "Returns", "the", "value", "of", "the", "decimals", "field" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L2391-L2400
220,437
moodle/moodle
lib/grade/grade_item.php
grade_item.get_formatted_range
function get_formatted_range($rangesdisplaytype=null, $rangesdecimalpoints=null) { global $USER; // Determine which display type to use for this average if (isset($USER->gradeediting) && array_key_exists($this->courseid, $USER->gradeediting) && $USER->gradeediting[$this->courseid]) { ...
php
function get_formatted_range($rangesdisplaytype=null, $rangesdecimalpoints=null) { global $USER; // Determine which display type to use for this average if (isset($USER->gradeediting) && array_key_exists($this->courseid, $USER->gradeediting) && $USER->gradeediting[$this->courseid]) { ...
[ "function", "get_formatted_range", "(", "$", "rangesdisplaytype", "=", "null", ",", "$", "rangesdecimalpoints", "=", "null", ")", "{", "global", "$", "USER", ";", "// Determine which display type to use for this average", "if", "(", "isset", "(", "$", "USER", "->", ...
Returns a string representing the range of grademin - grademax for this grade item. @param int $rangesdisplaytype @param int $rangesdecimalpoints @return string
[ "Returns", "a", "string", "representing", "the", "range", "of", "grademin", "-", "grademax", "for", "this", "grade", "item", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L2409-L2442
220,438
moodle/moodle
lib/grade/grade_item.php
grade_item.get_coefstring
public function get_coefstring() { $parent_category = $this->load_parent_category(); if ($this->is_category_item()) { $parent_category = $parent_category->load_parent_category(); } if ($parent_category->is_aggregationcoef_used()) { return $parent_category->get_co...
php
public function get_coefstring() { $parent_category = $this->load_parent_category(); if ($this->is_category_item()) { $parent_category = $parent_category->load_parent_category(); } if ($parent_category->is_aggregationcoef_used()) { return $parent_category->get_co...
[ "public", "function", "get_coefstring", "(", ")", "{", "$", "parent_category", "=", "$", "this", "->", "load_parent_category", "(", ")", ";", "if", "(", "$", "this", "->", "is_category_item", "(", ")", ")", "{", "$", "parent_category", "=", "$", "parent_ca...
Queries parent categories recursively to find the aggregationcoef type that applies to this grade item. @return string|false Returns the coefficient string of false is no coefficient is being used
[ "Queries", "parent", "categories", "recursively", "to", "find", "the", "aggregationcoef", "type", "that", "applies", "to", "this", "grade", "item", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L2449-L2460
220,439
moodle/moodle
lib/grade/grade_item.php
grade_item.can_control_visibility
public function can_control_visibility() { if (core_component::get_plugin_directory($this->itemtype, $this->itemmodule)) { return !plugin_supports($this->itemtype, $this->itemmodule, FEATURE_CONTROLS_GRADE_VISIBILITY, false); } return parent::can_control_visibility(); }
php
public function can_control_visibility() { if (core_component::get_plugin_directory($this->itemtype, $this->itemmodule)) { return !plugin_supports($this->itemtype, $this->itemmodule, FEATURE_CONTROLS_GRADE_VISIBILITY, false); } return parent::can_control_visibility(); }
[ "public", "function", "can_control_visibility", "(", ")", "{", "if", "(", "core_component", "::", "get_plugin_directory", "(", "$", "this", "->", "itemtype", ",", "$", "this", "->", "itemmodule", ")", ")", "{", "return", "!", "plugin_supports", "(", "$", "th...
Returns whether the grade item can control the visibility of the grades @return bool
[ "Returns", "whether", "the", "grade", "item", "can", "control", "the", "visibility", "of", "the", "grades" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L2467-L2472
220,440
moodle/moodle
lib/grade/grade_item.php
grade_item.get_context
public function get_context() { if ($this->itemtype == 'mod') { $modinfo = get_fast_modinfo($this->courseid); // Sometimes the course module cache is out of date and needs to be rebuilt. if (!isset($modinfo->instances[$this->itemmodule][$this->iteminstance])) { ...
php
public function get_context() { if ($this->itemtype == 'mod') { $modinfo = get_fast_modinfo($this->courseid); // Sometimes the course module cache is out of date and needs to be rebuilt. if (!isset($modinfo->instances[$this->itemmodule][$this->iteminstance])) { ...
[ "public", "function", "get_context", "(", ")", "{", "if", "(", "$", "this", "->", "itemtype", "==", "'mod'", ")", "{", "$", "modinfo", "=", "get_fast_modinfo", "(", "$", "this", "->", "courseid", ")", ";", "// Sometimes the course module cache is out of date and...
Helper function to get the accurate context for this grade column. @return context
[ "Helper", "function", "to", "get", "the", "accurate", "context", "for", "this", "grade", "column", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_item.php#L2496-L2518
220,441
moodle/moodle
message/output/email/classes/output/renderer.php
renderer.render_email_digest
public function render_email_digest(email_digest $emaildigest) { $data = $emaildigest->export_for_template($this); return $this->render_from_template('message_email/' . $this->get_template_name(), $data); }
php
public function render_email_digest(email_digest $emaildigest) { $data = $emaildigest->export_for_template($this); return $this->render_from_template('message_email/' . $this->get_template_name(), $data); }
[ "public", "function", "render_email_digest", "(", "email_digest", "$", "emaildigest", ")", "{", "$", "data", "=", "$", "emaildigest", "->", "export_for_template", "(", "$", "this", ")", ";", "return", "$", "this", "->", "render_from_template", "(", "'message_ema...
Formats the email used to send the certificate by the email_certificate_task. @param email_digest $emaildigest The certificate to email @return string
[ "Formats", "the", "email", "used", "to", "send", "the", "certificate", "by", "the", "email_certificate_task", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/output/email/classes/output/renderer.php#L46-L49
220,442
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.breakLinesForEmail
public static function breakLinesForEmail($str, $newlineChar = LF, $lineWidth = 76) { self::logDeprecatedFunction(); return t3lib_utility_Mail::breakLinesForEmail($str, $newlineChar, $lineWidth); }
php
public static function breakLinesForEmail($str, $newlineChar = LF, $lineWidth = 76) { self::logDeprecatedFunction(); return t3lib_utility_Mail::breakLinesForEmail($str, $newlineChar, $lineWidth); }
[ "public", "static", "function", "breakLinesForEmail", "(", "$", "str", ",", "$", "newlineChar", "=", "LF", ",", "$", "lineWidth", "=", "76", ")", "{", "self", "::", "logDeprecatedFunction", "(", ")", ";", "return", "t3lib_utility_Mail", "::", "breakLinesForEma...
Breaks up a single line of text for emails @param string $str The string to break up @param string $newlineChar The string to implode the broken lines with (default/typically \n) @param integer $lineWidth The line width @return string reformatted text @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - Use t3l...
[ "Breaks", "up", "a", "single", "line", "of", "text", "for", "emails" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L402-L405
220,443
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.cmpIP
public static function cmpIP($baseIP, $list) { $list = trim($list); if ($list === '') { return FALSE; } elseif ($list === '*') { return TRUE; } if (strpos($baseIP, ':') !== FALSE && self::validIPv6($baseIP)) { return self::cmpIPv6($baseIP, $list); } else { return self::cmpIPv4($baseIP, $list); ...
php
public static function cmpIP($baseIP, $list) { $list = trim($list); if ($list === '') { return FALSE; } elseif ($list === '*') { return TRUE; } if (strpos($baseIP, ':') !== FALSE && self::validIPv6($baseIP)) { return self::cmpIPv6($baseIP, $list); } else { return self::cmpIPv4($baseIP, $list); ...
[ "public", "static", "function", "cmpIP", "(", "$", "baseIP", ",", "$", "list", ")", "{", "$", "list", "=", "trim", "(", "$", "list", ")", ";", "if", "(", "$", "list", "===", "''", ")", "{", "return", "FALSE", ";", "}", "elseif", "(", "$", "list...
Match IP number with list of numbers with wildcard Dispatcher method for switching into specialised IPv4 and IPv6 methods. @param string $baseIP is the current remote IP address for instance, typ. REMOTE_ADDR @param string $list is a comma-list of IP-addresses to match with. *-wildcard allowed instead of number, plus ...
[ "Match", "IP", "number", "with", "list", "of", "numbers", "with", "wildcard", "Dispatcher", "method", "for", "switching", "into", "specialised", "IPv4", "and", "IPv6", "methods", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L415-L427
220,444
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.cmpIPv4
public static function cmpIPv4($baseIP, $list) { $IPpartsReq = explode('.', $baseIP); if (count($IPpartsReq) == 4) { $values = self::trimExplode(',', $list, 1); foreach ($values as $test) { $testList = explode('/', $test); if (count($testList) == 2) { list($test, $mask) = $testList; } else {...
php
public static function cmpIPv4($baseIP, $list) { $IPpartsReq = explode('.', $baseIP); if (count($IPpartsReq) == 4) { $values = self::trimExplode(',', $list, 1); foreach ($values as $test) { $testList = explode('/', $test); if (count($testList) == 2) { list($test, $mask) = $testList; } else {...
[ "public", "static", "function", "cmpIPv4", "(", "$", "baseIP", ",", "$", "list", ")", "{", "$", "IPpartsReq", "=", "explode", "(", "'.'", ",", "$", "baseIP", ")", ";", "if", "(", "count", "(", "$", "IPpartsReq", ")", "==", "4", ")", "{", "$", "va...
Match IPv4 number with list of numbers with wildcard @param string $baseIP is the current remote IP address for instance, typ. REMOTE_ADDR @param string $list is a comma-list of IP-addresses to match with. *-wildcard allowed instead of number, plus leaving out parts in the IP number is accepted as wildcard (eg. 192....
[ "Match", "IPv4", "number", "with", "list", "of", "numbers", "with", "wildcard" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L436-L475
220,445
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.cmpIPv6
public static function cmpIPv6($baseIP, $list) { $success = FALSE; // Policy default: Deny connection $baseIP = self::normalizeIPv6($baseIP); $values = self::trimExplode(',', $list, 1); foreach ($values as $test) { $testList = explode('/', $test); if (count($testList) == 2) { list($test, $mask) = $te...
php
public static function cmpIPv6($baseIP, $list) { $success = FALSE; // Policy default: Deny connection $baseIP = self::normalizeIPv6($baseIP); $values = self::trimExplode(',', $list, 1); foreach ($values as $test) { $testList = explode('/', $test); if (count($testList) == 2) { list($test, $mask) = $te...
[ "public", "static", "function", "cmpIPv6", "(", "$", "baseIP", ",", "$", "list", ")", "{", "$", "success", "=", "FALSE", ";", "// Policy default: Deny connection", "$", "baseIP", "=", "self", "::", "normalizeIPv6", "(", "$", "baseIP", ")", ";", "$", "value...
Match IPv6 address with a list of IPv6 prefixes @param string $baseIP is the current remote IP address for instance @param string $list is a comma-list of IPv6 prefixes, could also contain IPv4 addresses @return boolean TRUE if an baseIP matches any prefix
[ "Match", "IPv6", "address", "with", "a", "list", "of", "IPv6", "prefixes" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L484-L530
220,446
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.IPv6Hex2Bin
public static function IPv6Hex2Bin($hex) { // use PHP-function if PHP was compiled with IPv6-support if (defined('AF_INET6')) { $bin = inet_pton($hex); } else { $hex = self::normalizeIPv6($hex); $hex = str_replace(':', '', $hex); // Replace colon to nothing $bin = pack("H*" , $hex); } return $bin...
php
public static function IPv6Hex2Bin($hex) { // use PHP-function if PHP was compiled with IPv6-support if (defined('AF_INET6')) { $bin = inet_pton($hex); } else { $hex = self::normalizeIPv6($hex); $hex = str_replace(':', '', $hex); // Replace colon to nothing $bin = pack("H*" , $hex); } return $bin...
[ "public", "static", "function", "IPv6Hex2Bin", "(", "$", "hex", ")", "{", "// use PHP-function if PHP was compiled with IPv6-support", "if", "(", "defined", "(", "'AF_INET6'", ")", ")", "{", "$", "bin", "=", "inet_pton", "(", "$", "hex", ")", ";", "}", "else",...
Transform a regular IPv6 address from hex-representation into binary @param string $hex IPv6 address in hex-presentation @return string Binary representation (16 characters, 128 characters) @see IPv6Bin2Hex()
[ "Transform", "a", "regular", "IPv6", "address", "from", "hex", "-", "representation", "into", "binary" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L539-L549
220,447
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.IPv6Bin2Hex
public static function IPv6Bin2Hex($bin) { // use PHP-function if PHP was compiled with IPv6-support if (defined('AF_INET6')) { $hex = inet_ntop($bin); } else { $hex = unpack("H*" , $bin); $hex = chunk_split($hex[1], 4, ':'); // strip last colon (from chunk_split) $hex = substr($hex, 0, -1); ...
php
public static function IPv6Bin2Hex($bin) { // use PHP-function if PHP was compiled with IPv6-support if (defined('AF_INET6')) { $hex = inet_ntop($bin); } else { $hex = unpack("H*" , $bin); $hex = chunk_split($hex[1], 4, ':'); // strip last colon (from chunk_split) $hex = substr($hex, 0, -1); ...
[ "public", "static", "function", "IPv6Bin2Hex", "(", "$", "bin", ")", "{", "// use PHP-function if PHP was compiled with IPv6-support", "if", "(", "defined", "(", "'AF_INET6'", ")", ")", "{", "$", "hex", "=", "inet_ntop", "(", "$", "bin", ")", ";", "}", "else",...
Transform an IPv6 address from binary to hex-representation @param string $bin IPv6 address in hex-presentation @return string Binary representation (16 characters, 128 characters) @see IPv6Hex2Bin()
[ "Transform", "an", "IPv6", "address", "from", "binary", "to", "hex", "-", "representation" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L558-L573
220,448
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.normalizeIPv6
public static function normalizeIPv6($address) { $normalizedAddress = ''; $stageOneAddress = ''; // according to RFC lowercase-representation is recommended $address = strtolower($address); // normalized representation has 39 characters (0000:0000:0000:0000:0000:0000:0000:0000) if (strlen($address) == 3...
php
public static function normalizeIPv6($address) { $normalizedAddress = ''; $stageOneAddress = ''; // according to RFC lowercase-representation is recommended $address = strtolower($address); // normalized representation has 39 characters (0000:0000:0000:0000:0000:0000:0000:0000) if (strlen($address) == 3...
[ "public", "static", "function", "normalizeIPv6", "(", "$", "address", ")", "{", "$", "normalizedAddress", "=", "''", ";", "$", "stageOneAddress", "=", "''", ";", "// according to RFC lowercase-representation is recommended", "$", "address", "=", "strtolower", "(", "...
Normalize an IPv6 address to full length @param string $address Given IPv6 address @return string Normalized address @see compressIPv6()
[ "Normalize", "an", "IPv6", "address", "to", "full", "length" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L582-L642
220,449
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.compressIPv6
public static function compressIPv6($address) { // use PHP-function if PHP was compiled with IPv6-support if (defined('AF_INET6')) { $bin = inet_pton($address); $address = inet_ntop($bin); } else { $address = self::normalizeIPv6($address); // append one colon for easier handling // will be remo...
php
public static function compressIPv6($address) { // use PHP-function if PHP was compiled with IPv6-support if (defined('AF_INET6')) { $bin = inet_pton($address); $address = inet_ntop($bin); } else { $address = self::normalizeIPv6($address); // append one colon for easier handling // will be remo...
[ "public", "static", "function", "compressIPv6", "(", "$", "address", ")", "{", "// use PHP-function if PHP was compiled with IPv6-support", "if", "(", "defined", "(", "'AF_INET6'", ")", ")", "{", "$", "bin", "=", "inet_pton", "(", "$", "address", ")", ";", "$", ...
Compress an IPv6 address to the shortest notation @param string $address Given IPv6 address @return string Compressed address @see normalizeIPv6()
[ "Compress", "an", "IPv6", "address", "to", "the", "shortest", "notation" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L652-L684
220,450
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.cmpFQDN
public static function cmpFQDN($baseHost, $list) { $baseHost = trim($baseHost); if (empty($baseHost)) { return FALSE; } if (self::validIPv4($baseHost) || self::validIPv6($baseHost)) { // resolve hostname // note: this is reverse-lookup and can be randomly set as soon as somebody is able to set //...
php
public static function cmpFQDN($baseHost, $list) { $baseHost = trim($baseHost); if (empty($baseHost)) { return FALSE; } if (self::validIPv4($baseHost) || self::validIPv6($baseHost)) { // resolve hostname // note: this is reverse-lookup and can be randomly set as soon as somebody is able to set //...
[ "public", "static", "function", "cmpFQDN", "(", "$", "baseHost", ",", "$", "list", ")", "{", "$", "baseHost", "=", "trim", "(", "$", "baseHost", ")", ";", "if", "(", "empty", "(", "$", "baseHost", ")", ")", "{", "return", "FALSE", ";", "}", "if", ...
Match fully qualified domain name with list of strings with wildcard @param string $baseHost A hostname or an IPv4/IPv6-address (will by reverse-resolved; typically REMOTE_ADDR) @param string $list A comma-list of domain names to match with. *-wildcard allowed but cannot be part of a string, so it must match the full ...
[ "Match", "fully", "qualified", "domain", "name", "with", "list", "of", "strings", "with", "wildcard" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L729-L791
220,451
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.rmFromList
public static function rmFromList($element, $list) { $items = explode(',', $list); foreach ($items as $k => $v) { if ($v == $element) { unset($items[$k]); } } return implode(',', $items); }
php
public static function rmFromList($element, $list) { $items = explode(',', $list); foreach ($items as $k => $v) { if ($v == $element) { unset($items[$k]); } } return implode(',', $items); }
[ "public", "static", "function", "rmFromList", "(", "$", "element", ",", "$", "list", ")", "{", "$", "items", "=", "explode", "(", "','", ",", "$", "list", ")", ";", "foreach", "(", "$", "items", "as", "$", "k", "=>", "$", "v", ")", "{", "if", "...
Removes an item from a comma-separated list of items. @param string $element element to remove @param string $list comma-separated list of items (string) @return string new comma-separated list of items
[ "Removes", "an", "item", "from", "a", "comma", "-", "separated", "list", "of", "items", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L823-L831
220,452
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.int_from_ver
public static function int_from_ver($verNumberStr) { // Deprecation log is activated only for TYPO3 4.7 and above if (t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) >= 4007000) { self::logDeprecatedFunction(); } return t3lib_utility_VersionNumber::convertVersionNumberToInteger($ve...
php
public static function int_from_ver($verNumberStr) { // Deprecation log is activated only for TYPO3 4.7 and above if (t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) >= 4007000) { self::logDeprecatedFunction(); } return t3lib_utility_VersionNumber::convertVersionNumberToInteger($ve...
[ "public", "static", "function", "int_from_ver", "(", "$", "verNumberStr", ")", "{", "// Deprecation log is activated only for TYPO3 4.7 and above", "if", "(", "t3lib_utility_VersionNumber", "::", "convertVersionNumberToInteger", "(", "TYPO3_version", ")", ">=", "4007000", ")"...
Returns an integer from a three part version number, eg '4.12.3' -> 4012003 @param string $verNumberStr Version number on format x.x.x @return integer Integer version of version number (where each part can count to 999) @deprecated since TYPO3 4.6, will be removed in TYPO3 6.1 - Use t3lib_utility_VersionNumber::conver...
[ "Returns", "an", "integer", "from", "a", "three", "part", "version", "number", "eg", "4", ".", "12", ".", "3", "-", ">", "4012003" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L896-L902
220,453
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.hmac
public static function hmac($input, $additionalSecret = '') { $hashAlgorithm = 'sha1'; $hashBlocksize = 64; $hmac = ''; $secret = $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . $additionalSecret; if (extension_loaded('hash') && function_exists('hash_hmac') && function_exists('hash_algos') && in_array($...
php
public static function hmac($input, $additionalSecret = '') { $hashAlgorithm = 'sha1'; $hashBlocksize = 64; $hmac = ''; $secret = $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . $additionalSecret; if (extension_loaded('hash') && function_exists('hash_hmac') && function_exists('hash_algos') && in_array($...
[ "public", "static", "function", "hmac", "(", "$", "input", ",", "$", "additionalSecret", "=", "''", ")", "{", "$", "hashAlgorithm", "=", "'sha1'", ";", "$", "hashBlocksize", "=", "64", ";", "$", "hmac", "=", "''", ";", "$", "secret", "=", "$", "GLOBA...
Returns a proper HMAC on a given input string and secret TYPO3 encryption key. @param string $input Input string to create HMAC from @param string $additionalSecret additionalSecret to prevent hmac beeing used in a different context @return string resulting (hexadecimal) HMAC currently with a length of 40 (HMAC-SHA-1)
[ "Returns", "a", "proper", "HMAC", "on", "a", "given", "input", "string", "and", "secret", "TYPO3", "encryption", "key", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L950-L972
220,454
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.split_fileref
public static function split_fileref($fileref) { $reg = array(); if (preg_match('/(.*\/)(.*)$/', $fileref, $reg)) { $info['path'] = $reg[1]; $info['file'] = $reg[2]; } else { $info['path'] = ''; $info['file'] = $fileref; } $reg = ''; if (!is_dir($fileref) && preg_match('/(.*)\.([^\.]*$)/', $inf...
php
public static function split_fileref($fileref) { $reg = array(); if (preg_match('/(.*\/)(.*)$/', $fileref, $reg)) { $info['path'] = $reg[1]; $info['file'] = $reg[2]; } else { $info['path'] = ''; $info['file'] = $fileref; } $reg = ''; if (!is_dir($fileref) && preg_match('/(.*)\.([^\.]*$)/', $inf...
[ "public", "static", "function", "split_fileref", "(", "$", "fileref", ")", "{", "$", "reg", "=", "array", "(", ")", ";", "if", "(", "preg_match", "(", "'/(.*\\/)(.*)$/'", ",", "$", "fileref", ",", "$", "reg", ")", ")", "{", "$", "info", "[", "'path'"...
Splits a reference to a file in 5 parts @param string $fileref Filename/filepath to be analysed @return array Contains keys [path], [file], [filebody], [fileext], [realFileext]
[ "Splits", "a", "reference", "to", "a", "file", "in", "5", "parts" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L1005-L1026
220,455
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.slashJS
public static function slashJS($string, $extended = FALSE, $char = "'") { if ($extended) { $string = str_replace("\\", "\\\\", $string); } return str_replace($char, "\\" . $char, $string); }
php
public static function slashJS($string, $extended = FALSE, $char = "'") { if ($extended) { $string = str_replace("\\", "\\\\", $string); } return str_replace($char, "\\" . $char, $string); }
[ "public", "static", "function", "slashJS", "(", "$", "string", ",", "$", "extended", "=", "FALSE", ",", "$", "char", "=", "\"'\"", ")", "{", "if", "(", "$", "extended", ")", "{", "$", "string", "=", "str_replace", "(", "\"\\\\\"", ",", "\"\\\\\\\\\"", ...
This function is used to escape any ' -characters when transferring text to JavaScript! @param string $string String to escape @param boolean $extended If set, also backslashes are escaped. @param string $char The character to escape, default is ' (single-quote) @return string Processed input string
[ "This", "function", "is", "used", "to", "escape", "any", "-", "characters", "when", "transferring", "text", "to", "JavaScript!" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L1233-L1238
220,456
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.validEmail
public static function validEmail($email) { // enforce maximum length to prevent libpcre recursion crash bug #52929 in PHP // fixed in PHP 5.3.4; length restriction per SMTP RFC 2821 if (strlen($email) > 320) { return FALSE; } require_once(PATH_typo3 . 'contrib/idna/idna_convert.class.php'); $IDN = new...
php
public static function validEmail($email) { // enforce maximum length to prevent libpcre recursion crash bug #52929 in PHP // fixed in PHP 5.3.4; length restriction per SMTP RFC 2821 if (strlen($email) > 320) { return FALSE; } require_once(PATH_typo3 . 'contrib/idna/idna_convert.class.php'); $IDN = new...
[ "public", "static", "function", "validEmail", "(", "$", "email", ")", "{", "// enforce maximum length to prevent libpcre recursion crash bug #52929 in PHP", "// fixed in PHP 5.3.4; length restriction per SMTP RFC 2821", "if", "(", "strlen", "(", "$", "email", ")", ">", "320", ...
Checking syntax of input email address @param string $email Input string to evaluate @return boolean Returns TRUE if the $email address (input string) is valid
[ "Checking", "syntax", "of", "input", "email", "address" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L1268-L1278
220,457
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.generateRandomBytesFallback
protected static function generateRandomBytesFallback($bytesToReturn) { $bytes = ''; // We initialize with somewhat random. $randomState = $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . base_convert(memory_get_usage() % pow(10, 6), 10, 2) . microtime() . uniqid('') . getmypid(); while (!isset($bytes{$by...
php
protected static function generateRandomBytesFallback($bytesToReturn) { $bytes = ''; // We initialize with somewhat random. $randomState = $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . base_convert(memory_get_usage() % pow(10, 6), 10, 2) . microtime() . uniqid('') . getmypid(); while (!isset($bytes{$by...
[ "protected", "static", "function", "generateRandomBytesFallback", "(", "$", "bytesToReturn", ")", "{", "$", "bytes", "=", "''", ";", "// We initialize with somewhat random.", "$", "randomState", "=", "$", "GLOBALS", "[", "'TYPO3_CONF_VARS'", "]", "[", "'SYS'", "]", ...
Generate pseudo random bytes as last resort @param $bytesToReturn @return string
[ "Generate", "pseudo", "random", "bytes", "as", "last", "resort" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L1452-L1461
220,458
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.addSlashesOnArray
public static function addSlashesOnArray(array &$theArray) { foreach ($theArray as &$value) { if (is_array($value)) { self::addSlashesOnArray($value); } else { $value = addslashes($value); } } unset($value); reset($theArray); }
php
public static function addSlashesOnArray(array &$theArray) { foreach ($theArray as &$value) { if (is_array($value)) { self::addSlashesOnArray($value); } else { $value = addslashes($value); } } unset($value); reset($theArray); }
[ "public", "static", "function", "addSlashesOnArray", "(", "array", "&", "$", "theArray", ")", "{", "foreach", "(", "$", "theArray", "as", "&", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "self", "::", "addSlashesOnA...
AddSlash array This function traverses a multidimensional array and adds slashes to the values. NOTE that the input array is and argument by reference.!! Twin-function to stripSlashesOnArray @param array $theArray Multidimensional input array, (REFERENCE!) @return array
[ "AddSlash", "array", "This", "function", "traverses", "a", "multidimensional", "array", "and", "adds", "slashes", "to", "the", "values", ".", "NOTE", "that", "the", "input", "array", "is", "and", "argument", "by", "reference", ".", "!!", "Twin", "-", "functi...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L1792-L1802
220,459
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.stripSlashesOnArray
public static function stripSlashesOnArray(array &$theArray) { foreach ($theArray as &$value) { if (is_array($value)) { self::stripSlashesOnArray($value); } else { $value = stripslashes($value); } } unset($value); reset($theArray); }
php
public static function stripSlashesOnArray(array &$theArray) { foreach ($theArray as &$value) { if (is_array($value)) { self::stripSlashesOnArray($value); } else { $value = stripslashes($value); } } unset($value); reset($theArray); }
[ "public", "static", "function", "stripSlashesOnArray", "(", "array", "&", "$", "theArray", ")", "{", "foreach", "(", "$", "theArray", "as", "&", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "self", "::", "stripSlashe...
StripSlash array This function traverses a multidimensional array and strips slashes to the values. NOTE that the input array is and argument by reference.!! Twin-function to addSlashesOnArray @param array $theArray Multidimensional input array, (REFERENCE!) @return array
[ "StripSlash", "array", "This", "function", "traverses", "a", "multidimensional", "array", "and", "strips", "slashes", "to", "the", "values", ".", "NOTE", "that", "the", "input", "array", "is", "and", "argument", "by", "reference", ".", "!!", "Twin", "-", "fu...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L1813-L1823
220,460
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.remapArrayKeys
public static function remapArrayKeys(&$array, $mappingTable) { if (is_array($mappingTable)) { foreach ($mappingTable as $old => $new) { if ($new && isset($array[$old])) { $array[$new] = $array[$old]; unset ($array[$old]); } } } }
php
public static function remapArrayKeys(&$array, $mappingTable) { if (is_array($mappingTable)) { foreach ($mappingTable as $old => $new) { if ($new && isset($array[$old])) { $array[$new] = $array[$old]; unset ($array[$old]); } } } }
[ "public", "static", "function", "remapArrayKeys", "(", "&", "$", "array", ",", "$", "mappingTable", ")", "{", "if", "(", "is_array", "(", "$", "mappingTable", ")", ")", "{", "foreach", "(", "$", "mappingTable", "as", "$", "old", "=>", "$", "new", ")", ...
Rename Array keys with a given mapping table @param array $array Array by reference which should be remapped @param array $mappingTable Array with remap information, array/$oldKey => $newKey)
[ "Rename", "Array", "keys", "with", "a", "given", "mapping", "table" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L1848-L1857
220,461
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.split_tag_attributes
public static function split_tag_attributes($tag) { $tag_tmp = trim(preg_replace('/^<[^[:space:]]*/', '', trim($tag))); // Removes any > in the end of the string $tag_tmp = trim(rtrim($tag_tmp, '>')); $value = array(); while (strcmp($tag_tmp, '')) { // Compared with empty string instead , 030102 $firstCh...
php
public static function split_tag_attributes($tag) { $tag_tmp = trim(preg_replace('/^<[^[:space:]]*/', '', trim($tag))); // Removes any > in the end of the string $tag_tmp = trim(rtrim($tag_tmp, '>')); $value = array(); while (strcmp($tag_tmp, '')) { // Compared with empty string instead , 030102 $firstCh...
[ "public", "static", "function", "split_tag_attributes", "(", "$", "tag", ")", "{", "$", "tag_tmp", "=", "trim", "(", "preg_replace", "(", "'/^<[^[:space:]]*/'", ",", "''", ",", "trim", "(", "$", "tag", ")", ")", ")", ";", "// Removes any > in the end of the st...
Returns an array with the 'components' from an attribute list from an HTML tag. The result is normally analyzed by get_tag_attributes Removes tag-name if found @param string $tag HTML-tag string (or attributes only) @return array Array with the attribute values.
[ "Returns", "an", "array", "with", "the", "components", "from", "an", "attribute", "list", "from", "an", "HTML", "tag", ".", "The", "result", "is", "normally", "analyzed", "by", "get_tag_attributes", "Removes", "tag", "-", "name", "if", "found" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L2037-L2061
220,462
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.xml2tree
public static function xml2tree($string, $depth = 999) { $parser = xml_parser_create(); $vals = array(); $index = array(); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0); xml_parse_into_struct($parser, $string, $vals, $index); if (xml...
php
public static function xml2tree($string, $depth = 999) { $parser = xml_parser_create(); $vals = array(); $index = array(); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0); xml_parse_into_struct($parser, $string, $vals, $index); if (xml...
[ "public", "static", "function", "xml2tree", "(", "$", "string", ",", "$", "depth", "=", "999", ")", "{", "$", "parser", "=", "xml_parser_create", "(", ")", ";", "$", "vals", "=", "array", "(", ")", ";", "$", "index", "=", "array", "(", ")", ";", ...
Parses XML input into a PHP array with associative keys @param string $string XML data input @param integer $depth Number of element levels to resolve the XML into an array. Any further structure will be set as XML. @return mixed The array with the parsed structure unless the XML parser returns with an error in which ...
[ "Parses", "XML", "input", "into", "a", "PHP", "array", "with", "associative", "keys" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L2129-L2197
220,463
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.fixPermissions
public static function fixPermissions($path, $recursive = FALSE) { if (TYPO3_OS != 'WIN') { $result = FALSE; // Make path absolute if (!self::isAbsPath($path)) { $path = self::getFileAbsFileName($path, FALSE); } if (self::isAllowedAbsPath($path)) { if (@is_file($path)) { // "@" is ther...
php
public static function fixPermissions($path, $recursive = FALSE) { if (TYPO3_OS != 'WIN') { $result = FALSE; // Make path absolute if (!self::isAbsPath($path)) { $path = self::getFileAbsFileName($path, FALSE); } if (self::isAllowedAbsPath($path)) { if (@is_file($path)) { // "@" is ther...
[ "public", "static", "function", "fixPermissions", "(", "$", "path", ",", "$", "recursive", "=", "FALSE", ")", "{", "if", "(", "TYPO3_OS", "!=", "'WIN'", ")", "{", "$", "result", "=", "FALSE", ";", "// Make path absolute", "if", "(", "!", "self", "::", ...
Sets the file system mode and group ownership of a file or a folder. @param string $path Path of file or folder, must not be escaped. Path can be absolute or relative @param boolean $recursive If set, also fixes permissions of files and folders in the folder (if $path is a folder) @return mixed TRUE on success, FALSE ...
[ "Sets", "the", "file", "system", "mode", "and", "group", "ownership", "of", "a", "file", "or", "a", "folder", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L2806-L2854
220,464
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.mkdir_deep
public static function mkdir_deep($directory, $deepDirectory = '') { if (!is_string($directory)) { throw new \InvalidArgumentException( 'The specified directory is of type "' . gettype($directory) . '" but a string is expected.', 1303662955 ); } if (!is_string($deepDirectory)) { throw new \Invali...
php
public static function mkdir_deep($directory, $deepDirectory = '') { if (!is_string($directory)) { throw new \InvalidArgumentException( 'The specified directory is of type "' . gettype($directory) . '" but a string is expected.', 1303662955 ); } if (!is_string($deepDirectory)) { throw new \Invali...
[ "public", "static", "function", "mkdir_deep", "(", "$", "directory", ",", "$", "deepDirectory", "=", "''", ")", "{", "if", "(", "!", "is_string", "(", "$", "directory", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'The specified dir...
Creates a directory - including parent directories if necessary and sets permissions on newly created directories. @param string $directory Target directory to create. Must a have trailing slash if second parameter is given! Example: "/root/typo3site/typo3temp/foo/" @param string $deepDirectory Directory to create. Th...
[ "Creates", "a", "directory", "-", "including", "parent", "directories", "if", "necessary", "and", "sets", "permissions", "on", "newly", "created", "directories", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L2947-L2968
220,465
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.createDirectoryPath
protected static function createDirectoryPath($fullDirectoryPath) { $currentPath = $fullDirectoryPath; $firstCreatedPath = ''; $permissionMask = octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']); if (!@is_dir($currentPath)) { do { $firstCreatedPath = $currentPath; $separatorPosition = str...
php
protected static function createDirectoryPath($fullDirectoryPath) { $currentPath = $fullDirectoryPath; $firstCreatedPath = ''; $permissionMask = octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']); if (!@is_dir($currentPath)) { do { $firstCreatedPath = $currentPath; $separatorPosition = str...
[ "protected", "static", "function", "createDirectoryPath", "(", "$", "fullDirectoryPath", ")", "{", "$", "currentPath", "=", "$", "fullDirectoryPath", ";", "$", "firstCreatedPath", "=", "''", ";", "$", "permissionMask", "=", "octdec", "(", "$", "GLOBALS", "[", ...
Creates directories for the specified paths if they do not exist. This functions sets proper permission mask but does not set proper user and group. @static @param string $fullDirectoryPath @return string Path to the the first created directory in the hierarchy @see t3lib_div::mkdir_deep @throws \RuntimeException If d...
[ "Creates", "directories", "for", "the", "specified", "paths", "if", "they", "do", "not", "exist", ".", "This", "functions", "sets", "proper", "permission", "mask", "but", "does", "not", "set", "proper", "user", "and", "group", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L2981-L2998
220,466
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.rmdir
public static function rmdir($path, $removeNonEmpty = FALSE) { $OK = FALSE; $path = preg_replace('|/$|', '', $path); // Remove trailing slash if (file_exists($path)) { $OK = TRUE; if (is_dir($path)) { if ($removeNonEmpty == TRUE && $handle = opendir($path)) { while ($OK && FALSE !== ($file = read...
php
public static function rmdir($path, $removeNonEmpty = FALSE) { $OK = FALSE; $path = preg_replace('|/$|', '', $path); // Remove trailing slash if (file_exists($path)) { $OK = TRUE; if (is_dir($path)) { if ($removeNonEmpty == TRUE && $handle = opendir($path)) { while ($OK && FALSE !== ($file = read...
[ "public", "static", "function", "rmdir", "(", "$", "path", ",", "$", "removeNonEmpty", "=", "FALSE", ")", "{", "$", "OK", "=", "FALSE", ";", "$", "path", "=", "preg_replace", "(", "'|/$|'", ",", "''", ",", "$", "path", ")", ";", "// Remove trailing sla...
Wrapper function for rmdir, allowing recursive deletion of folders and files @param string $path Absolute path to folder, see PHP rmdir() function. Removes trailing slash internally. @param boolean $removeNonEmpty Allow deletion of non-empty directories @return boolean TRUE if @rmdir went well!
[ "Wrapper", "function", "for", "rmdir", "allowing", "recursive", "deletion", "of", "folders", "and", "files" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3007-L3036
220,467
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.getFilesInDir
public static function getFilesInDir($path, $extensionList = '', $prependPath = FALSE, $order = '', $excludePattern = '') { // Initialize variables: $filearray = array(); $sortarray = array(); $path = rtrim($path, '/'); // Find files+directories: if (@is_dir($path)) { $extensionList = strtolower($ext...
php
public static function getFilesInDir($path, $extensionList = '', $prependPath = FALSE, $order = '', $excludePattern = '') { // Initialize variables: $filearray = array(); $sortarray = array(); $path = rtrim($path, '/'); // Find files+directories: if (@is_dir($path)) { $extensionList = strtolower($ext...
[ "public", "static", "function", "getFilesInDir", "(", "$", "path", ",", "$", "extensionList", "=", "''", ",", "$", "prependPath", "=", "FALSE", ",", "$", "order", "=", "''", ",", "$", "excludePattern", "=", "''", ")", "{", "// Initialize variables:", "$", ...
Returns an array with the names of files in a specific path @param string $path Is the path to the file @param string $extensionList is the comma list of extensions to read only (blank = all) @param boolean $prependPath If set, then the path is prepended the file names. Otherwise only the file names are returned in th...
[ "Returns", "an", "array", "with", "the", "names", "of", "files", "in", "a", "specific", "path" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3073-L3119
220,468
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.getAllFilesAndFoldersInPath
public static function getAllFilesAndFoldersInPath(array $fileArr, $path, $extList = '', $regDirs = FALSE, $recursivityLevels = 99, $excludePattern = '') { if ($regDirs) { $fileArr[] = $path; } $fileArr = array_merge($fileArr, self::getFilesInDir($path, $extList, 1, 1, $excludePattern)); $dirs = self::get_d...
php
public static function getAllFilesAndFoldersInPath(array $fileArr, $path, $extList = '', $regDirs = FALSE, $recursivityLevels = 99, $excludePattern = '') { if ($regDirs) { $fileArr[] = $path; } $fileArr = array_merge($fileArr, self::getFilesInDir($path, $extList, 1, 1, $excludePattern)); $dirs = self::get_d...
[ "public", "static", "function", "getAllFilesAndFoldersInPath", "(", "array", "$", "fileArr", ",", "$", "path", ",", "$", "extList", "=", "''", ",", "$", "regDirs", "=", "FALSE", ",", "$", "recursivityLevels", "=", "99", ",", "$", "excludePattern", "=", "''...
Recursively gather all files and folders of a path. @param array $fileArr Empty input array (will have files added to it) @param string $path The path to read recursively from (absolute) (include trailing slash!) @param string $extList Comma list of file extensions: Only files with extensions in this list (if applicab...
[ "Recursively", "gather", "all", "files", "and", "folders", "of", "a", "path", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3132-L3147
220,469
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.getMaxUploadFileSize
public static function getMaxUploadFileSize($localLimit = 0) { // don't allow more than the global max file size at all $t3Limit = (intval($localLimit > 0 ? $localLimit : $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'])); // as TYPO3 is handling the file size in KB, multiply by 1024 to get bytes $t3Limit = $...
php
public static function getMaxUploadFileSize($localLimit = 0) { // don't allow more than the global max file size at all $t3Limit = (intval($localLimit > 0 ? $localLimit : $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'])); // as TYPO3 is handling the file size in KB, multiply by 1024 to get bytes $t3Limit = $...
[ "public", "static", "function", "getMaxUploadFileSize", "(", "$", "localLimit", "=", "0", ")", "{", "// don't allow more than the global max file size at all", "$", "t3Limit", "=", "(", "intval", "(", "$", "localLimit", ">", "0", "?", "$", "localLimit", ":", "$", ...
Returns the maximum upload size for a file that is allowed. Measured in KB. This might be handy to find out the real upload limit that is possible for this TYPO3 installation. The first parameter can be used to set something that overrides the maxFileSize, usually for the TCA values. @param integer $localLimit: the nu...
[ "Returns", "the", "maximum", "upload", "size", "for", "a", "file", "that", "is", "allowed", ".", "Measured", "in", "KB", ".", "This", "might", "be", "handy", "to", "find", "out", "the", "real", "upload", "limit", "that", "is", "possible", "for", "this", ...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3234-L3250
220,470
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.getBytesFromSizeMeasurement
public static function getBytesFromSizeMeasurement($measurement) { $bytes = doubleval($measurement); if (stripos($measurement, 'G')) { $bytes *= 1024 * 1024 * 1024; } elseif (stripos($measurement, 'M')) { $bytes *= 1024 * 1024; } elseif (stripos($measurement, 'K')) { $bytes *= 1024; } return $bytes...
php
public static function getBytesFromSizeMeasurement($measurement) { $bytes = doubleval($measurement); if (stripos($measurement, 'G')) { $bytes *= 1024 * 1024 * 1024; } elseif (stripos($measurement, 'M')) { $bytes *= 1024 * 1024; } elseif (stripos($measurement, 'K')) { $bytes *= 1024; } return $bytes...
[ "public", "static", "function", "getBytesFromSizeMeasurement", "(", "$", "measurement", ")", "{", "$", "bytes", "=", "doubleval", "(", "$", "measurement", ")", ";", "if", "(", "stripos", "(", "$", "measurement", ",", "'G'", ")", ")", "{", "$", "bytes", "...
Gets the bytes value from a measurement string like "100k". @param string $measurement: The measurement (e.g. "100k") @return integer The bytes value (e.g. 102400)
[ "Gets", "the", "bytes", "value", "from", "a", "measurement", "string", "like", "100k", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3258-L3268
220,471
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.createVersionNumberedFilename
public static function createVersionNumberedFilename($file, $forceQueryString = FALSE) { $lookupFile = explode('?', $file); $path = self::resolveBackPath(self::dirname(PATH_thisScript) . '/' . $lookupFile[0]); if (TYPO3_MODE == 'FE') { $mode = strtolower($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['versionNumberI...
php
public static function createVersionNumberedFilename($file, $forceQueryString = FALSE) { $lookupFile = explode('?', $file); $path = self::resolveBackPath(self::dirname(PATH_thisScript) . '/' . $lookupFile[0]); if (TYPO3_MODE == 'FE') { $mode = strtolower($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['versionNumberI...
[ "public", "static", "function", "createVersionNumberedFilename", "(", "$", "file", ",", "$", "forceQueryString", "=", "FALSE", ")", "{", "$", "lookupFile", "=", "explode", "(", "'?'", ",", "$", "file", ")", ";", "$", "path", "=", "self", "::", "resolveBack...
Function for static version numbers on files, based on the filemtime This will make the filename automatically change when a file is changed, and by that re-cached by the browser. If the file does not exist physically the original file passed to the function is returned without the timestamp. Behaviour is influenced ...
[ "Function", "for", "static", "version", "numbers", "on", "files", "based", "on", "the", "filemtime" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3297-L3344
220,472
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.getHostname
public static function getHostname($requestHost = TRUE) { $host = ''; // If not called from the command-line, resolve on getIndpEnv() // Note that TYPO3_REQUESTTYPE is not used here as it may not yet be defined if ($requestHost && (!defined('TYPO3_cliMode') || !TYPO3_cliMode)) { $host = self::getIndpEnv('H...
php
public static function getHostname($requestHost = TRUE) { $host = ''; // If not called from the command-line, resolve on getIndpEnv() // Note that TYPO3_REQUESTTYPE is not used here as it may not yet be defined if ($requestHost && (!defined('TYPO3_cliMode') || !TYPO3_cliMode)) { $host = self::getIndpEnv('H...
[ "public", "static", "function", "getHostname", "(", "$", "requestHost", "=", "TRUE", ")", "{", "$", "host", "=", "''", ";", "// If not called from the command-line, resolve on getIndpEnv()", "// Note that TYPO3_REQUESTTYPE is not used here as it may not yet be defined", "if", "...
Get the fully-qualified domain name of the host. @param boolean $requestHost Use request host (when not in CLI mode). @return string The fully-qualified host name.
[ "Get", "the", "fully", "-", "qualified", "domain", "name", "of", "the", "host", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3837-L3868
220,473
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.validPathStr
public static function validPathStr($theFile) { if (strpos($theFile, '//') === FALSE && strpos($theFile, '\\') === FALSE && !preg_match('#(?:^\.\.|/\.\./|[[:cntrl:]])#u', $theFile)) { return TRUE; } return FALSE; }
php
public static function validPathStr($theFile) { if (strpos($theFile, '//') === FALSE && strpos($theFile, '\\') === FALSE && !preg_match('#(?:^\.\.|/\.\./|[[:cntrl:]])#u', $theFile)) { return TRUE; } return FALSE; }
[ "public", "static", "function", "validPathStr", "(", "$", "theFile", ")", "{", "if", "(", "strpos", "(", "$", "theFile", ",", "'//'", ")", "===", "FALSE", "&&", "strpos", "(", "$", "theFile", ",", "'\\\\'", ")", "===", "FALSE", "&&", "!", "preg_match",...
Checks for malicious file paths. Returns TRUE if no '//', '..', '\' or control characters are found in the $theFile. This should make sure that the path is not pointing 'backwards' and further doesn't contain double/back slashes. So it's compatible with the UNIX style path strings valid for TYPO3 internally. @param s...
[ "Checks", "for", "malicious", "file", "paths", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3926-L3932
220,474
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.isAllowedAbsPath
public static function isAllowedAbsPath($path) { if (self::isAbsPath($path) && self::validPathStr($path) && (self::isFirstPartOfStr($path, PATH_site) || ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'] && self::isFirstPartOfStr($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'])) ) )...
php
public static function isAllowedAbsPath($path) { if (self::isAbsPath($path) && self::validPathStr($path) && (self::isFirstPartOfStr($path, PATH_site) || ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'] && self::isFirstPartOfStr($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'])) ) )...
[ "public", "static", "function", "isAllowedAbsPath", "(", "$", "path", ")", "{", "if", "(", "self", "::", "isAbsPath", "(", "$", "path", ")", "&&", "self", "::", "validPathStr", "(", "$", "path", ")", "&&", "(", "self", "::", "isFirstPartOfStr", "(", "$...
Returns TRUE if the path is absolute, without backpath '..' and within the PATH_site OR within the lockRootPath @param string $path File path to evaluate @return boolean
[ "Returns", "TRUE", "if", "the", "path", "is", "absolute", "without", "backpath", "..", "and", "within", "the", "PATH_site", "OR", "within", "the", "lockRootPath" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3956-L3966
220,475
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.verifyFilenameAgainstDenyPattern
public static function verifyFilenameAgainstDenyPattern($filename) { // Filenames are not allowed to contain control characters if (preg_match('/[[:cntrl:]]/', $filename)) { return FALSE; } if (strcmp($filename, '') && strcmp($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'], '')) { $result = preg_ma...
php
public static function verifyFilenameAgainstDenyPattern($filename) { // Filenames are not allowed to contain control characters if (preg_match('/[[:cntrl:]]/', $filename)) { return FALSE; } if (strcmp($filename, '') && strcmp($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'], '')) { $result = preg_ma...
[ "public", "static", "function", "verifyFilenameAgainstDenyPattern", "(", "$", "filename", ")", "{", "// Filenames are not allowed to contain control characters", "if", "(", "preg_match", "(", "'/[[:cntrl:]]/'", ",", "$", "filename", ")", ")", "{", "return", "FALSE", ";"...
Verifies the input filename against the 'fileDenyPattern'. Returns TRUE if OK. @param string $filename File path to evaluate @return boolean
[ "Verifies", "the", "input", "filename", "against", "the", "fileDenyPattern", ".", "Returns", "TRUE", "if", "OK", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3974-L3987
220,476
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.sanitizeLocalUrl
public static function sanitizeLocalUrl($url = '') { $sanitizedUrl = ''; $decodedUrl = rawurldecode($url); if (!empty($url) && self::removeXSS($decodedUrl) === $decodedUrl) { $testAbsoluteUrl = self::resolveBackPath($decodedUrl); $testRelativeUrl = self::resolveBackPath( self::dirname(self::getIndpEnv(...
php
public static function sanitizeLocalUrl($url = '') { $sanitizedUrl = ''; $decodedUrl = rawurldecode($url); if (!empty($url) && self::removeXSS($decodedUrl) === $decodedUrl) { $testAbsoluteUrl = self::resolveBackPath($decodedUrl); $testRelativeUrl = self::resolveBackPath( self::dirname(self::getIndpEnv(...
[ "public", "static", "function", "sanitizeLocalUrl", "(", "$", "url", "=", "''", ")", "{", "$", "sanitizedUrl", "=", "''", ";", "$", "decodedUrl", "=", "rawurldecode", "(", "$", "url", ")", ";", "if", "(", "!", "empty", "(", "$", "url", ")", "&&", "...
Checks if a given string is a valid frame URL to be loaded in the backend. @param string $url potential URL to check @return string either $url if $url is considered to be harmless, or an empty string otherwise
[ "Checks", "if", "a", "given", "string", "is", "a", "valid", "frame", "URL", "to", "be", "loaded", "in", "the", "backend", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L3997-L4029
220,477
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.cHashParams
public static function cHashParams($addQueryParams) { t3lib_div::logDeprecatedFunction(); $params = explode('&', substr($addQueryParams, 1)); // Splitting parameters up /* @var $cacheHash t3lib_cacheHash */ $cacheHash = t3lib_div::makeInstance('t3lib_cacheHash'); $pA = $cacheHash->getRelevantParameters($addQu...
php
public static function cHashParams($addQueryParams) { t3lib_div::logDeprecatedFunction(); $params = explode('&', substr($addQueryParams, 1)); // Splitting parameters up /* @var $cacheHash t3lib_cacheHash */ $cacheHash = t3lib_div::makeInstance('t3lib_cacheHash'); $pA = $cacheHash->getRelevantParameters($addQu...
[ "public", "static", "function", "cHashParams", "(", "$", "addQueryParams", ")", "{", "t3lib_div", "::", "logDeprecatedFunction", "(", ")", ";", "$", "params", "=", "explode", "(", "'&'", ",", "substr", "(", "$", "addQueryParams", ",", "1", ")", ")", ";", ...
Splits the input query-parameters into an array with certain parameters filtered out. Used to create the cHash value @param string $addQueryParams Query-parameters: "&xxx=yyy&zzz=uuu" @return array Array with key/value pairs of query-parameters WITHOUT a certain list of variable names (like id, type, no_cache etc.) an...
[ "Splits", "the", "input", "query", "-", "parameters", "into", "an", "array", "with", "certain", "parameters", "filtered", "out", ".", "Used", "to", "create", "the", "cHash", "value" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L4145-L4169
220,478
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.generateCHash
public static function generateCHash($addQueryParams) { t3lib_div::logDeprecatedFunction(); /* @var $cacheHash t3lib_cacheHash */ $cacheHash = t3lib_div::makeInstance('t3lib_cacheHash'); return $cacheHash->generateForParameters($addQueryParams); }
php
public static function generateCHash($addQueryParams) { t3lib_div::logDeprecatedFunction(); /* @var $cacheHash t3lib_cacheHash */ $cacheHash = t3lib_div::makeInstance('t3lib_cacheHash'); return $cacheHash->generateForParameters($addQueryParams); }
[ "public", "static", "function", "generateCHash", "(", "$", "addQueryParams", ")", "{", "t3lib_div", "::", "logDeprecatedFunction", "(", ")", ";", "/* @var $cacheHash t3lib_cacheHash */", "$", "cacheHash", "=", "t3lib_div", "::", "makeInstance", "(", "'t3lib_cacheHash'",...
Returns the cHash based on provided query parameters and added values from internal call @param string $addQueryParams Query-parameters: "&xxx=yyy&zzz=uuu" @return string Hash of all the values @see t3lib_div::cHashParams(), t3lib_div::calculateCHash() @deprecated since TYPO3 4.7 - will be removed in TYPO3 6.1 - use t...
[ "Returns", "the", "cHash", "based", "on", "provided", "query", "parameters", "and", "added", "values", "from", "internal", "call" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L4179-L4184
220,479
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.calculateCHash
public static function calculateCHash($params) { t3lib_div::logDeprecatedFunction(); /* @var $cacheHash t3lib_cacheHash */ $cacheHash = t3lib_div::makeInstance('t3lib_cacheHash'); return $cacheHash->calculateCacheHash($params); }
php
public static function calculateCHash($params) { t3lib_div::logDeprecatedFunction(); /* @var $cacheHash t3lib_cacheHash */ $cacheHash = t3lib_div::makeInstance('t3lib_cacheHash'); return $cacheHash->calculateCacheHash($params); }
[ "public", "static", "function", "calculateCHash", "(", "$", "params", ")", "{", "t3lib_div", "::", "logDeprecatedFunction", "(", ")", ";", "/* @var $cacheHash t3lib_cacheHash */", "$", "cacheHash", "=", "t3lib_div", "::", "makeInstance", "(", "'t3lib_cacheHash'", ")",...
Calculates the cHash based on the provided parameters @param array $params Array of key-value pairs @return string Hash of all the values @deprecated since TYPO3 4.7 - will be removed in TYPO3 6.1 - use t3lib_cacheHash instead
[ "Calculates", "the", "cHash", "based", "on", "the", "provided", "parameters" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L4193-L4198
220,480
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.llXmlAutoFileName
public static function llXmlAutoFileName($fileRef, $language, $sameLocation = FALSE) { if ($sameLocation) { $location = 'EXT:'; } else { $location = 'typo3conf/l10n/' . $language . '/'; // Default location of translations } // Analyse file reference: if (self::isFirstPartOfStr($fileRef, PATH_typo3 . '...
php
public static function llXmlAutoFileName($fileRef, $language, $sameLocation = FALSE) { if ($sameLocation) { $location = 'EXT:'; } else { $location = 'typo3conf/l10n/' . $language . '/'; // Default location of translations } // Analyse file reference: if (self::isFirstPartOfStr($fileRef, PATH_typo3 . '...
[ "public", "static", "function", "llXmlAutoFileName", "(", "$", "fileRef", ",", "$", "language", ",", "$", "sameLocation", "=", "FALSE", ")", "{", "if", "(", "$", "sameLocation", ")", "{", "$", "location", "=", "'EXT:'", ";", "}", "else", "{", "$", "loc...
Returns auto-filename for locallang-XML localizations. @param string $fileRef Absolute file reference to locallang-XML file. Must be inside system/global/local extension @param string $language Language key @param boolean $sameLocation if TRUE, then locallang-XML localization file name will be returned with same direc...
[ "Returns", "auto", "-", "filename", "for", "locallang", "-", "XML", "localizations", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L4503-L4548
220,481
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.resolveAllSheetsInDS
public static function resolveAllSheetsInDS(array $dataStructArray) { if (is_array($dataStructArray['sheets'])) { $out = array('sheets' => array()); foreach ($dataStructArray['sheets'] as $sheetId => $sDat) { list($ds, $aS) = self::resolveSheetDefInDS($dataStructArray, $sheetId); if ($sheetId == $aS) { ...
php
public static function resolveAllSheetsInDS(array $dataStructArray) { if (is_array($dataStructArray['sheets'])) { $out = array('sheets' => array()); foreach ($dataStructArray['sheets'] as $sheetId => $sDat) { list($ds, $aS) = self::resolveSheetDefInDS($dataStructArray, $sheetId); if ($sheetId == $aS) { ...
[ "public", "static", "function", "resolveAllSheetsInDS", "(", "array", "$", "dataStructArray", ")", "{", "if", "(", "is_array", "(", "$", "dataStructArray", "[", "'sheets'", "]", ")", ")", "{", "$", "out", "=", "array", "(", "'sheets'", "=>", "array", "(", ...
Resolves ALL sheet definitions in dataStructArray If no sheet is found, then the default "sDEF" will be created with the dataStructure inside. @param array $dataStructArray Input data structure, possibly with a sheet-definition and references to external data source files. @return array Output data structure with all ...
[ "Resolves", "ALL", "sheet", "definitions", "in", "dataStructArray", "If", "no", "sheet", "is", "found", "then", "the", "default", "sDEF", "will", "be", "created", "with", "the", "dataStructure", "inside", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L4630-L4644
220,482
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.getValidClassPrefixes
public static function getValidClassPrefixes() { $validPrefixes = array('tx_', 'Tx_', 'user_', 'User_'); if ( isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['additionalAllowedClassPrefixes']) && is_string($GLOBALS['TYPO3_CONF_VARS']['SYS']['additionalAllowedClassPrefixes']) ) { $validPrefixes = array_merge( ...
php
public static function getValidClassPrefixes() { $validPrefixes = array('tx_', 'Tx_', 'user_', 'User_'); if ( isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['additionalAllowedClassPrefixes']) && is_string($GLOBALS['TYPO3_CONF_VARS']['SYS']['additionalAllowedClassPrefixes']) ) { $validPrefixes = array_merge( ...
[ "public", "static", "function", "getValidClassPrefixes", "(", ")", "{", "$", "validPrefixes", "=", "array", "(", "'tx_'", ",", "'Tx_'", ",", "'user_'", ",", "'User_'", ")", ";", "if", "(", "isset", "(", "$", "GLOBALS", "[", "'TYPO3_CONF_VARS'", "]", "[", ...
Returns all valid class prefixes. @return array Array of valid prefixed of class names
[ "Returns", "all", "valid", "class", "prefixes", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L4859-L4871
220,483
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.getClassName
protected static function getClassName($className) { if (class_exists($className)) { while (class_exists('ux_' . $className, FALSE)) { $className = 'ux_' . $className; } } return $className; }
php
protected static function getClassName($className) { if (class_exists($className)) { while (class_exists('ux_' . $className, FALSE)) { $className = 'ux_' . $className; } } return $className; }
[ "protected", "static", "function", "getClassName", "(", "$", "className", ")", "{", "if", "(", "class_exists", "(", "$", "className", ")", ")", "{", "while", "(", "class_exists", "(", "'ux_'", ".", "$", "className", ",", "FALSE", ")", ")", "{", "$", "c...
Returns the class name for a new instance, taking into account the class-extension API. @param string $className Base class name to evaluate @return string Final class name to instantiate with "new [classname]"
[ "Returns", "the", "class", "name", "for", "a", "new", "instance", "taking", "into", "account", "the", "class", "-", "extension", "API", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L4976-L4984
220,484
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.setSingletonInstance
public static function setSingletonInstance($className, t3lib_Singleton $instance) { self::checkInstanceClassName($className, $instance); self::$singletonInstances[$className] = $instance; }
php
public static function setSingletonInstance($className, t3lib_Singleton $instance) { self::checkInstanceClassName($className, $instance); self::$singletonInstances[$className] = $instance; }
[ "public", "static", "function", "setSingletonInstance", "(", "$", "className", ",", "t3lib_Singleton", "$", "instance", ")", "{", "self", "::", "checkInstanceClassName", "(", "$", "className", ",", "$", "instance", ")", ";", "self", "::", "$", "singletonInstance...
Sets the instance of a singleton class to be returned by makeInstance. If this function is called multiple times for the same $className, makeInstance will return the last set instance. Warning: This is a helper method for unit tests. Do not call this directly in production code! @see makeInstance @param string $cla...
[ "Sets", "the", "instance", "of", "a", "singleton", "class", "to", "be", "returned", "by", "makeInstance", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L5001-L5004
220,485
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.addInstance
public static function addInstance($className, $instance) { self::checkInstanceClassName($className, $instance); if ($instance instanceof t3lib_Singleton) { throw new InvalidArgumentException( '$instance must not be an instance of t3lib_Singleton. ' . 'For setting singletons, please use setSingletonIns...
php
public static function addInstance($className, $instance) { self::checkInstanceClassName($className, $instance); if ($instance instanceof t3lib_Singleton) { throw new InvalidArgumentException( '$instance must not be an instance of t3lib_Singleton. ' . 'For setting singletons, please use setSingletonIns...
[ "public", "static", "function", "addInstance", "(", "$", "className", ",", "$", "instance", ")", "{", "self", "::", "checkInstanceClassName", "(", "$", "className", ",", "$", "instance", ")", ";", "if", "(", "$", "instance", "instanceof", "t3lib_Singleton", ...
Sets the instance of a non-singleton class to be returned by makeInstance. If this function is called multiple times for the same $className, makeInstance will return the instances in the order in which they have been added (FIFO). Warning: This is a helper method for unit tests. Do not call this directly in producti...
[ "Sets", "the", "instance", "of", "a", "non", "-", "singleton", "class", "to", "be", "returned", "by", "makeInstance", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L5023-L5038
220,486
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.makeInstanceService
public static function makeInstanceService($serviceType, $serviceSubType = '', $excludeServiceKeys = array()) { $error = FALSE; if (!is_array($excludeServiceKeys)) { $excludeServiceKeys = self::trimExplode(',', $excludeServiceKeys, 1); } $requestInfo = array( 'requestedServiceType' => $serviceType, '...
php
public static function makeInstanceService($serviceType, $serviceSubType = '', $excludeServiceKeys = array()) { $error = FALSE; if (!is_array($excludeServiceKeys)) { $excludeServiceKeys = self::trimExplode(',', $excludeServiceKeys, 1); } $requestInfo = array( 'requestedServiceType' => $serviceType, '...
[ "public", "static", "function", "makeInstanceService", "(", "$", "serviceType", ",", "$", "serviceSubType", "=", "''", ",", "$", "excludeServiceKeys", "=", "array", "(", ")", ")", "{", "$", "error", "=", "FALSE", ";", "if", "(", "!", "is_array", "(", "$"...
Find the best service and check if it works. Returns object of the service class. @param string $serviceType Type of service (service key). @param string $serviceSubType Sub type like file extensions or similar. Defined by the service. @param mixed $excludeServiceKeys List of service keys which should be excluded in t...
[ "Find", "the", "best", "service", "and", "check", "if", "it", "works", ".", "Returns", "object", "of", "the", "service", "class", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L5086-L5145
220,487
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.quoted_printable
public static function quoted_printable($string, $maxlen = 76) { // Make sure the string contains only Unix line breaks $string = str_replace(CRLF, LF, $string); // Replace Windows breaks (\r\n) $string = str_replace(CR, LF, $string); // Replace Mac breaks (\r) $linebreak = LF; // Default line break for Unix ...
php
public static function quoted_printable($string, $maxlen = 76) { // Make sure the string contains only Unix line breaks $string = str_replace(CRLF, LF, $string); // Replace Windows breaks (\r\n) $string = str_replace(CR, LF, $string); // Replace Mac breaks (\r) $linebreak = LF; // Default line break for Unix ...
[ "public", "static", "function", "quoted_printable", "(", "$", "string", ",", "$", "maxlen", "=", "76", ")", "{", "// Make sure the string contains only Unix line breaks", "$", "string", "=", "str_replace", "(", "CRLF", ",", "LF", ",", "$", "string", ")", ";", ...
Implementation of quoted-printable encode. See RFC 1521, section 5.1 Quoted-Printable Content-Transfer-Encoding @param string $string Content to encode @param integer $maxlen Length of the lines, default is 76 @return string The QP encoded string
[ "Implementation", "of", "quoted", "-", "printable", "encode", ".", "See", "RFC", "1521", "section", "5", ".", "1", "Quoted", "-", "Printable", "Content", "-", "Transfer", "-", "Encoding" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L5259-L5295
220,488
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.freetypeDpiComp
public static function freetypeDpiComp($font_size) { $dpi = intval($GLOBALS['TYPO3_CONF_VARS']['GFX']['TTFdpi']); if ($dpi != 72) { $font_size = $font_size / $dpi * 72; } return $font_size; }
php
public static function freetypeDpiComp($font_size) { $dpi = intval($GLOBALS['TYPO3_CONF_VARS']['GFX']['TTFdpi']); if ($dpi != 72) { $font_size = $font_size / $dpi * 72; } return $font_size; }
[ "public", "static", "function", "freetypeDpiComp", "(", "$", "font_size", ")", "{", "$", "dpi", "=", "intval", "(", "$", "GLOBALS", "[", "'TYPO3_CONF_VARS'", "]", "[", "'GFX'", "]", "[", "'TTFdpi'", "]", ")", ";", "if", "(", "$", "dpi", "!=", "72", "...
Function to compensate for FreeType2 96 dpi @param integer $font_size Fontsize for freetype function call @return integer Compensated fontsize based on $GLOBALS['TYPO3_CONF_VARS']['GFX']['TTFdpi']
[ "Function", "to", "compensate", "for", "FreeType2", "96", "dpi" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L5429-L5435
220,489
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.initSysLog
public static function initSysLog() { // for CLI logging name is <fqdn-hostname>:<TYPO3-path> // Note that TYPO3_REQUESTTYPE is not used here as it may not yet be defined if (defined('TYPO3_cliMode') && TYPO3_cliMode) { $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogHost'] =...
php
public static function initSysLog() { // for CLI logging name is <fqdn-hostname>:<TYPO3-path> // Note that TYPO3_REQUESTTYPE is not used here as it may not yet be defined if (defined('TYPO3_cliMode') && TYPO3_cliMode) { $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogHost'] =...
[ "public", "static", "function", "initSysLog", "(", ")", "{", "// for CLI logging name is <fqdn-hostname>:<TYPO3-path>", "// Note that TYPO3_REQUESTTYPE is not used here as it may not yet be defined", "if", "(", "defined", "(", "'TYPO3_cliMode'", ")", "&&", "TYPO3_cliMode", ")", "...
Initialize the system log. @return void @see sysLog()
[ "Initialize", "the", "system", "log", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L5443-L5479
220,490
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.deprecationLog
public static function deprecationLog($msg) { if (!$GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) { return; } $log = $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']; $date = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ': '); ...
php
public static function deprecationLog($msg) { if (!$GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) { return; } $log = $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']; $date = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ': '); ...
[ "public", "static", "function", "deprecationLog", "(", "$", "msg", ")", "{", "if", "(", "!", "$", "GLOBALS", "[", "'TYPO3_CONF_VARS'", "]", "[", "'SYS'", "]", "[", "'enableDeprecationLog'", "]", ")", "{", "return", ";", "}", "$", "log", "=", "$", "GLOB...
Writes a message to the deprecation log. @param string $msg Message (in English). @return void
[ "Writes", "a", "message", "to", "the", "deprecation", "log", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L5608-L5650
220,491
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.logDeprecatedFunction
public static function logDeprecatedFunction() { if (!$GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) { return; } // This require_once is needed for deprecation calls // thrown early during bootstrap, if the autoloader is // not instantiated yet. This can happen for example if // ext_loc...
php
public static function logDeprecatedFunction() { if (!$GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) { return; } // This require_once is needed for deprecation calls // thrown early during bootstrap, if the autoloader is // not instantiated yet. This can happen for example if // ext_loc...
[ "public", "static", "function", "logDeprecatedFunction", "(", ")", "{", "if", "(", "!", "$", "GLOBALS", "[", "'TYPO3_CONF_VARS'", "]", "[", "'SYS'", "]", "[", "'enableDeprecationLog'", "]", ")", "{", "return", ";", "}", "// This require_once is needed for deprecat...
Logs a call to a deprecated function. The log message will be taken from the annotation. @return void
[ "Logs", "a", "call", "to", "a", "deprecated", "function", ".", "The", "log", "message", "will", "be", "taken", "from", "the", "annotation", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L5671-L5707
220,492
moodle/moodle
lib/typo3/class.t3lib_div.php
t3lib_div.flushOutputBuffers
public static function flushOutputBuffers() { $obContent = ''; while ($content = ob_get_clean()) { $obContent .= $content; } // if previously a "Content-Encoding: whatever" has been set, we have to unset it if (!headers_sent()) { $headersList = headers_list(); foreach ($headersList as $header) { ...
php
public static function flushOutputBuffers() { $obContent = ''; while ($content = ob_get_clean()) { $obContent .= $content; } // if previously a "Content-Encoding: whatever" has been set, we have to unset it if (!headers_sent()) { $headersList = headers_list(); foreach ($headersList as $header) { ...
[ "public", "static", "function", "flushOutputBuffers", "(", ")", "{", "$", "obContent", "=", "''", ";", "while", "(", "$", "content", "=", "ob_get_clean", "(", ")", ")", "{", "$", "obContent", ".=", "$", "content", ";", "}", "// if previously a \"Content-Enco...
Ends and flushes all output buffers @return void
[ "Ends", "and", "flushes", "all", "output", "buffers" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_div.php#L5815-L5836
220,493
moodle/moodle
calendar/classes/local/event/mappers/create_update_form_mapper.php
create_update_form_mapper.from_legacy_event_to_data
public function from_legacy_event_to_data(\calendar_event $legacyevent) { $legacyevent->count_repeats(); $data = $legacyevent->properties(); $data->timedurationuntil = $legacyevent->timestart + $legacyevent->timeduration; $data->duration = (empty($legacyevent->timeduration)) ? 0 : 1; ...
php
public function from_legacy_event_to_data(\calendar_event $legacyevent) { $legacyevent->count_repeats(); $data = $legacyevent->properties(); $data->timedurationuntil = $legacyevent->timestart + $legacyevent->timeduration; $data->duration = (empty($legacyevent->timeduration)) ? 0 : 1; ...
[ "public", "function", "from_legacy_event_to_data", "(", "\\", "calendar_event", "$", "legacyevent", ")", "{", "$", "legacyevent", "->", "count_repeats", "(", ")", ";", "$", "data", "=", "$", "legacyevent", "->", "properties", "(", ")", ";", "$", "data", "->"...
Generate the appropriate data for the form from a legacy event. @param \calendar_event $legacyevent @return stdClass
[ "Generate", "the", "appropriate", "data", "for", "the", "form", "from", "a", "legacy", "event", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/classes/local/event/mappers/create_update_form_mapper.php#L53-L80
220,494
moodle/moodle
calendar/classes/local/event/mappers/create_update_form_mapper.php
create_update_form_mapper.from_data_to_event_properties
public function from_data_to_event_properties(\stdClass $data) { $properties = clone($data); if ($data->eventtype == 'group') { if (isset($data->groupcourseid)) { $properties->courseid = $data->groupcourseid; unset($properties->groupcourseid); } ...
php
public function from_data_to_event_properties(\stdClass $data) { $properties = clone($data); if ($data->eventtype == 'group') { if (isset($data->groupcourseid)) { $properties->courseid = $data->groupcourseid; unset($properties->groupcourseid); } ...
[ "public", "function", "from_data_to_event_properties", "(", "\\", "stdClass", "$", "data", ")", "{", "$", "properties", "=", "clone", "(", "$", "data", ")", ";", "if", "(", "$", "data", "->", "eventtype", "==", "'group'", ")", "{", "if", "(", "isset", ...
Generate the appropriate calendar_event properties from the form data. @param \stdClass $data @return stdClass
[ "Generate", "the", "appropriate", "calendar_event", "properties", "from", "the", "form", "data", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/classes/local/event/mappers/create_update_form_mapper.php#L88-L116
220,495
moodle/moodle
calendar/classes/local/event/mappers/create_update_form_mapper.php
create_update_form_mapper.get_time_duration_from_form_data
private function get_time_duration_from_form_data(\stdClass $data) { if ($data->duration == 1) { return $data->timedurationuntil - $data->timestart; } else if ($data->duration == 2) { return $data->timedurationminutes * MINSECS; } else { return 0; } ...
php
private function get_time_duration_from_form_data(\stdClass $data) { if ($data->duration == 1) { return $data->timedurationuntil - $data->timestart; } else if ($data->duration == 2) { return $data->timedurationminutes * MINSECS; } else { return 0; } ...
[ "private", "function", "get_time_duration_from_form_data", "(", "\\", "stdClass", "$", "data", ")", "{", "if", "(", "$", "data", "->", "duration", "==", "1", ")", "{", "return", "$", "data", "->", "timedurationuntil", "-", "$", "data", "->", "timestart", "...
A helper function to calculate the time duration for an event based on the event_form data. @param \stdClass $data event_form data @return int
[ "A", "helper", "function", "to", "calculate", "the", "time", "duration", "for", "an", "event", "based", "on", "the", "event_form", "data", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/classes/local/event/mappers/create_update_form_mapper.php#L125-L133
220,496
moodle/moodle
admin/tool/log/store/database/classes/helper.php
helper.get_drivers
public static function get_drivers() { return array( '' => get_string('choosedots'), 'native/mysqli' => \moodle_database::get_driver_instance('mysqli', 'native')->get_name(), 'native/mariadb' => \moodle_database::get_driver_instance('mariadb', 'native')->get_na...
php
public static function get_drivers() { return array( '' => get_string('choosedots'), 'native/mysqli' => \moodle_database::get_driver_instance('mysqli', 'native')->get_name(), 'native/mariadb' => \moodle_database::get_driver_instance('mariadb', 'native')->get_na...
[ "public", "static", "function", "get_drivers", "(", ")", "{", "return", "array", "(", "''", "=>", "get_string", "(", "'choosedots'", ")", ",", "'native/mysqli'", "=>", "\\", "moodle_database", "::", "get_driver_instance", "(", "'mysqli'", ",", "'native'", ")", ...
Returns list of fully working database drivers present in system. @return array
[ "Returns", "list", "of", "fully", "working", "database", "drivers", "present", "in", "system", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/log/store/database/classes/helper.php#L40-L49
220,497
moodle/moodle
admin/tool/log/store/database/classes/helper.php
helper.get_level_options
public static function get_level_options() { return array( \core\event\base::LEVEL_TEACHING => get_string('teaching', 'logstore_database'), \core\event\base::LEVEL_PARTICIPATING => get_string('participating', 'logstore_database'), \core\event\base::LEVEL_OTHER =>...
php
public static function get_level_options() { return array( \core\event\base::LEVEL_TEACHING => get_string('teaching', 'logstore_database'), \core\event\base::LEVEL_PARTICIPATING => get_string('participating', 'logstore_database'), \core\event\base::LEVEL_OTHER =>...
[ "public", "static", "function", "get_level_options", "(", ")", "{", "return", "array", "(", "\\", "core", "\\", "event", "\\", "base", "::", "LEVEL_TEACHING", "=>", "get_string", "(", "'teaching'", ",", "'logstore_database'", ")", ",", "\\", "core", "\\", "e...
Get a list of edu levels. @return array
[ "Get", "a", "list", "of", "edu", "levels", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/log/store/database/classes/helper.php#L56-L62
220,498
moodle/moodle
mod/forum/classes/task/send_user_digests.php
send_user_digests.prepare_data
protected function prepare_data(int $timenow) { global $DB; $sql = "SELECT p.*, f.id AS forum, f.course FROM {forum_queue} q INNER JOIN {forum_posts} p ON p.id = q.postid INNER JOIN {forum_discussions} d ON d.id = p.discussion INNER JOIN {forum} f O...
php
protected function prepare_data(int $timenow) { global $DB; $sql = "SELECT p.*, f.id AS forum, f.course FROM {forum_queue} q INNER JOIN {forum_posts} p ON p.id = q.postid INNER JOIN {forum_discussions} d ON d.id = p.discussion INNER JOIN {forum} f O...
[ "protected", "function", "prepare_data", "(", "int", "$", "timenow", ")", "{", "global", "$", "DB", ";", "$", "sql", "=", "\"SELECT p.*, f.id AS forum, f.course\n FROM {forum_queue} q\n INNER JOIN {forum_posts} p ON p.id = q.postid\n INNER JOIN ...
Prepare the data for this run. Note: This will also remove posts from the queue. @param int $timenow
[ "Prepare", "the", "data", "for", "this", "run", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/task/send_user_digests.php#L272-L328
220,499
moodle/moodle
mod/forum/classes/task/send_user_digests.php
send_user_digests.empty_queue
protected function empty_queue(int $userid, int $timemodified) : void { global $DB; $DB->delete_records_select('forum_queue', "userid = :userid AND timemodified < :timemodified", [ 'userid' => $userid, 'timemodified' => $timemodified, ]); }
php
protected function empty_queue(int $userid, int $timemodified) : void { global $DB; $DB->delete_records_select('forum_queue', "userid = :userid AND timemodified < :timemodified", [ 'userid' => $userid, 'timemodified' => $timemodified, ]); }
[ "protected", "function", "empty_queue", "(", "int", "$", "userid", ",", "int", "$", "timemodified", ")", ":", "void", "{", "global", "$", "DB", ";", "$", "DB", "->", "delete_records_select", "(", "'forum_queue'", ",", "\"userid = :userid AND timemodified < :timemo...
Empty the queue of posts for this user. @param int $userid user id which queue elements are going to be removed. @param int $timemodified up time limit of the queue elements to be removed.
[ "Empty", "the", "queue", "of", "posts", "for", "this", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/task/send_user_digests.php#L336-L343