apache
wp-content
jetpack-waf
mu-plugins
plugins
activitypub
audioigniter
cloudron-sso
gitium
gp-premium
jetpack-protect
menu-icons
openid-connect-generic
rss-importer
simple-local-avatars
smtp-mailer
two-factor
wp-piwik
wp-webauthn
blocks
css
js
languages
wp-webauthn-vendor
beberlei
brick
composer
fgrosse
league
nyholm
psr
ramsey
spomky-labs
symfony
thecodingmachine
safe
deprecated
generated
Exceptions
apache.php
apcu.php
array.php
bzip2.php
calendar.php
classobj.php
com.php
cubrid.php
curl.php
datetime.php
dir.php
eio.php
errorfunc.php
exec.php
fileinfo.php
filesystem.php
filter.php
fpm.php
ftp.php
funchand.php
functionsList.php
gmp.php
gnupg.php
hash.php
ibase.php
ibmDb2.php
iconv.php
image.php
imap.php
info.php
ingres-ii.php
inotify.php
json.php
ldap.php
libxml.php
lzf.php
mailparse.php
mbstring.php
misc.php
msql.php
mysql.php
mysqli.php
mysqlndMs.php
mysqlndQc.php
network.php
oci8.php
opcache.php
openssl.php
outcontrol.php
password.php
pcntl.php
pcre.php
pdf.php
pgsql.php
posix.php
ps.php
pspell.php
readline.php
rpminfo.php
rrd.php
sem.php
session.php
shmop.php
simplexml.php
sockets.php
sodium.php
solr.php
spl.php
sqlsrv.php
ssdeep.php
ssh2.php
stream.php
strings.php
swoole.php
uodbc.php
uopz.php
url.php
var.php
xdiff.php
xml.php
xmlrpc.php
yaml.php
yaz.php
zip.php
zlib.php
lib
LICENSE
README.md
composer.json
rector-migrate-0.7.php
web-auth
web-token
autoload.php
LICENSE
readme.txt
wp-webauthn.php
wwa-admin-content.php
wwa-ajax.php
wwa-compatibility.php
wwa-functions.php
wwa-menus.php
wwa-profile-content.php
wwa-shortcodes.php
wwa-version.php
index.php
themes
w3tc-config
index.php
.gitignore
htaccess
php.ini
69 lines
1.7 KiB
PHP
69 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace Safe;
|
|
|
|
use Safe\Exceptions\ShmopException;
|
|
|
|
/**
|
|
* shmop_delete is used to delete a shared memory block.
|
|
*
|
|
* @param resource $shmid The shared memory block resource created by
|
|
* shmop_open
|
|
* @throws ShmopException
|
|
*
|
|
*/
|
|
function shmop_delete($shmid): void
|
|
{
|
|
error_clear_last();
|
|
$result = \shmop_delete($shmid);
|
|
if ($result === false) {
|
|
throw ShmopException::createFromPhpError();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* shmop_read will read a string from shared memory block.
|
|
*
|
|
* @param resource $shmid The shared memory block identifier created by
|
|
* shmop_open
|
|
* @param int $start Offset from which to start reading
|
|
* @param int $count The number of bytes to read.
|
|
* 0 reads shmop_size($shmid) - $start bytes.
|
|
* @return string Returns the data.
|
|
* @throws ShmopException
|
|
*
|
|
*/
|
|
function shmop_read($shmid, int $start, int $count): string
|
|
{
|
|
error_clear_last();
|
|
$result = \shmop_read($shmid, $start, $count);
|
|
if ($result === false) {
|
|
throw ShmopException::createFromPhpError();
|
|
}
|
|
return $result;
|
|
}
|
|
|
|
|
|
/**
|
|
* shmop_write will write a string into shared memory block.
|
|
*
|
|
* @param resource $shmid The shared memory block identifier created by
|
|
* shmop_open
|
|
* @param string $data A string to write into shared memory block
|
|
* @param int $offset Specifies where to start writing data inside the shared memory
|
|
* segment.
|
|
* @return int The size of the written data.
|
|
* @throws ShmopException
|
|
*
|
|
*/
|
|
function shmop_write($shmid, string $data, int $offset): int
|
|
{
|
|
error_clear_last();
|
|
$result = \shmop_write($shmid, $data, $offset);
|
|
if ($result === false) {
|
|
throw ShmopException::createFromPhpError();
|
|
}
|
|
return $result;
|
|
}
|