- 🇳🇿New Zealand quietone
These files were removed in #3129043: Move core database drivers to modules of their own → .
- Status changed to Active
over 1 year ago 10:22am 14 August 2023
The core database drivers, moved to core modules, do not have a documentation comment for the methods they implement; in some cases, the documentation comment is not complete and it does not describe the required parameters or the return value. This happens for example for the Drupal\sqlite\Driver\Database\sqlite\Connection
class, for the following methods.
public function driver() {
return 'sqlite';
}
public function databaseType() {
return 'sqlite';
}
/**
* SQLite compatibility implementation for the SUBSTRING() SQL function.
*/
public static function sqlFunctionSubstring($string, $from, $length) {
return substr($string, $from - 1, $length);
}
/**
* SQLite compatibility implementation for the SUBSTRING_INDEX() SQL function.
*/
public static function sqlFunctionSubstringIndex($string, $delimiter, $count) {
// If string is empty, simply return an empty string.
if (empty($string)) {
return '';
}
$end = 0;
for ($i = 0; $i < $count; $i++) {
$end = strpos($string, $delimiter, $end + 1);
if ($end === FALSE) {
$end = strlen($string);
}
}
return substr($string, 0, $end);
}
/**
* SQLite compatibility implementation for the RAND() SQL function.
*/
public static function sqlFunctionRand($seed = NULL) {
if (isset($seed)) {
mt_srand($seed);
}
return mt_rand() / mt_getrandmax();
}
/**
* SQLite compatibility implementation for the REGEXP SQL operator.
*
* The REGEXP operator is natively known, but not implemented by default.
*
* @see http://www.sqlite.org/lang_expr.html#regexp
*/
public static function sqlFunctionRegexp($pattern, $subject) {
// preg_quote() cannot be used here, since $pattern may contain reserved
// regular expression characters already (such as ^, $, etc). Therefore,
// use a rare character as PCRE delimiter.
$pattern = '#' . addcslashes($pattern, '#') . '#i';
return preg_match($pattern, $subject);
}
Active
11.0 🔥
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
These files were removed in #3129043: Move core database drivers to modules of their own → .