Exceptions
5 days ago
apache.php
5 days ago
apcu.php
5 days ago
array.php
5 days ago
bzip2.php
5 days ago
calendar.php
5 days ago
classobj.php
5 days ago
com.php
5 days ago
cubrid.php
5 days ago
curl.php
5 days ago
datetime.php
5 days ago
dir.php
5 days ago
eio.php
5 days ago
errorfunc.php
5 days ago
exec.php
5 days ago
fileinfo.php
5 days ago
filesystem.php
5 days ago
filter.php
5 days ago
fpm.php
5 days ago
ftp.php
5 days ago
funchand.php
5 days ago
functionsList.php
5 days ago
gmp.php
5 days ago
gnupg.php
5 days ago
hash.php
5 days ago
ibase.php
5 days ago
ibmDb2.php
5 days ago
iconv.php
5 days ago
image.php
5 days ago
imap.php
5 days ago
info.php
5 days ago
ingres-ii.php
5 days ago
inotify.php
5 days ago
json.php
5 days ago
ldap.php
5 days ago
libxml.php
5 days ago
lzf.php
5 days ago
mailparse.php
5 days ago
mbstring.php
5 days ago
misc.php
5 days ago
msql.php
5 days ago
mysql.php
5 days ago
mysqli.php
5 days ago
mysqlndMs.php
5 days ago
mysqlndQc.php
5 days ago
network.php
5 days ago
oci8.php
5 days ago
opcache.php
5 days ago
openssl.php
5 days ago
outcontrol.php
5 days ago
password.php
5 days ago
pcntl.php
5 days ago
pcre.php
5 days ago
pdf.php
5 days ago
pgsql.php
5 days ago
posix.php
5 days ago
ps.php
5 days ago
pspell.php
5 days ago
readline.php
5 days ago
rpminfo.php
5 days ago
rrd.php
5 days ago
sem.php
5 days ago
session.php
5 days ago
shmop.php
5 days ago
simplexml.php
5 days ago
sockets.php
5 days ago
sodium.php
5 days ago
solr.php
5 days ago
spl.php
5 days ago
sqlsrv.php
5 days ago
ssdeep.php
5 days ago
ssh2.php
5 days ago
stream.php
5 days ago
strings.php
5 days ago
swoole.php
5 days ago
uodbc.php
5 days ago
uopz.php
5 days ago
url.php
5 days ago
var.php
5 days ago
xdiff.php
5 days ago
xml.php
5 days ago
xmlrpc.php
5 days ago
yaml.php
5 days ago
yaz.php
5 days ago
zip.php
5 days ago
zlib.php
5 days ago
mysqlndQc.php
99 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePressVendor\Safe; |
| 4 | |
| 5 | use ProfilePressVendor\Safe\Exceptions\MysqlndQcException; |
| 6 | /** |
| 7 | * Flush all cache contents. |
| 8 | * |
| 9 | * Flushing the cache is a storage handler responsibility. |
| 10 | * All built-in storage handler but the |
| 11 | * memcache storage |
| 12 | * handler support flushing the cache. The |
| 13 | * memcache |
| 14 | * storage handler cannot flush its cache contents. |
| 15 | * |
| 16 | * User-defined storage handler may or may not support the operation. |
| 17 | * |
| 18 | * @throws MysqlndQcException |
| 19 | * |
| 20 | */ |
| 21 | function mysqlnd_qc_clear_cache(): void |
| 22 | { |
| 23 | error_clear_last(); |
| 24 | $result = \ProfilePressVendor\mysqlnd_qc_clear_cache(); |
| 25 | if ($result === \false) { |
| 26 | throw MysqlndQcException::createFromPhpError(); |
| 27 | } |
| 28 | } |
| 29 | /** |
| 30 | * Installs a callback which decides whether a statement is cached. |
| 31 | * |
| 32 | * There are several ways of hinting PELC/mysqlnd_qc to cache a query. |
| 33 | * By default, PECL/mysqlnd_qc attempts to cache a if caching of all statements |
| 34 | * is enabled or the query string begins with a certain SQL hint. |
| 35 | * The plugin internally calls a function named is_select() |
| 36 | * to find out. This internal function can be replaced with a user-defined callback. |
| 37 | * Then, the user-defined callback is responsible to decide whether the plugin |
| 38 | * attempts to cache a statement. Because the internal function is replaced |
| 39 | * with the callback, the callback gains full control. The callback is free |
| 40 | * to ignore the configuration setting mysqlnd_qc.cache_by_default |
| 41 | * and SQL hints. |
| 42 | * |
| 43 | * The callback is invoked for every statement inspected by the plugin. |
| 44 | * It is given the statements string as a parameter. The callback returns |
| 45 | * FALSE if the statement shall not be cached. It returns TRUE to |
| 46 | * make the plugin attempt to cache the statements result set, if any. |
| 47 | * A so-created cache entry is given the default TTL set with the |
| 48 | * PHP configuration directive mysqlnd_qc.ttl. |
| 49 | * If a different TTL shall be used, the callback returns a numeric |
| 50 | * value to be used as the TTL. |
| 51 | * |
| 52 | * The internal is_select function is part of the internal |
| 53 | * cache storage handler interface. Thus, a user-defined storage handler |
| 54 | * offers the same capabilities. |
| 55 | * |
| 56 | * @param string $callback |
| 57 | * @return mixed Returns TRUE on success. |
| 58 | * @throws MysqlndQcException |
| 59 | * |
| 60 | */ |
| 61 | function mysqlnd_qc_set_is_select(string $callback) |
| 62 | { |
| 63 | error_clear_last(); |
| 64 | $result = \ProfilePressVendor\mysqlnd_qc_set_is_select($callback); |
| 65 | if ($result === \false) { |
| 66 | throw MysqlndQcException::createFromPhpError(); |
| 67 | } |
| 68 | return $result; |
| 69 | } |
| 70 | /** |
| 71 | * Sets the storage handler used by the query cache. A list of available |
| 72 | * storage handler can be obtained from |
| 73 | * mysqlnd_qc_get_available_handlers. |
| 74 | * Which storage are available depends on the compile time |
| 75 | * configuration of the query cache plugin. The |
| 76 | * default storage handler is always available. |
| 77 | * All other storage handler must be enabled explicitly when building the |
| 78 | * extension. |
| 79 | * |
| 80 | * @param string $handler Handler can be of type string representing the name of a |
| 81 | * built-in storage handler or an object of type |
| 82 | * mysqlnd_qc_handler_default. |
| 83 | * The names of the built-in storage handler are |
| 84 | * default, |
| 85 | * APC, |
| 86 | * MEMCACHE, |
| 87 | * sqlite. |
| 88 | * @throws MysqlndQcException |
| 89 | * |
| 90 | */ |
| 91 | function mysqlnd_qc_set_storage_handler(string $handler): void |
| 92 | { |
| 93 | error_clear_last(); |
| 94 | $result = \ProfilePressVendor\mysqlnd_qc_set_storage_handler($handler); |
| 95 | if ($result === \false) { |
| 96 | throw MysqlndQcException::createFromPhpError(); |
| 97 | } |
| 98 | } |
| 99 |