Exceptions
6 days ago
apache.php
6 days ago
apcu.php
6 days ago
array.php
6 days ago
bzip2.php
6 days ago
calendar.php
6 days ago
classobj.php
6 days ago
com.php
6 days ago
cubrid.php
6 days ago
curl.php
6 days ago
datetime.php
6 days ago
dir.php
6 days ago
eio.php
6 days ago
errorfunc.php
6 days ago
exec.php
6 days ago
fileinfo.php
6 days ago
filesystem.php
6 days ago
filter.php
6 days ago
fpm.php
6 days ago
ftp.php
6 days ago
funchand.php
6 days ago
functionsList.php
6 days ago
gmp.php
6 days ago
gnupg.php
6 days ago
hash.php
6 days ago
ibase.php
6 days ago
ibmDb2.php
6 days ago
iconv.php
6 days ago
image.php
6 days ago
imap.php
6 days ago
info.php
6 days ago
ingres-ii.php
6 days ago
inotify.php
6 days ago
json.php
6 days ago
ldap.php
6 days ago
libxml.php
6 days ago
lzf.php
6 days ago
mailparse.php
6 days ago
mbstring.php
6 days ago
misc.php
6 days ago
msql.php
6 days ago
mysql.php
6 days ago
mysqli.php
6 days ago
mysqlndMs.php
6 days ago
mysqlndQc.php
6 days ago
network.php
6 days ago
oci8.php
6 days ago
opcache.php
6 days ago
openssl.php
6 days ago
outcontrol.php
6 days ago
password.php
6 days ago
pcntl.php
6 days ago
pcre.php
6 days ago
pdf.php
6 days ago
pgsql.php
6 days ago
posix.php
6 days ago
ps.php
6 days ago
pspell.php
6 days ago
readline.php
6 days ago
rpminfo.php
6 days ago
rrd.php
6 days ago
sem.php
6 days ago
session.php
6 days ago
shmop.php
6 days ago
simplexml.php
6 days ago
sockets.php
6 days ago
sodium.php
6 days ago
solr.php
6 days ago
spl.php
6 days ago
sqlsrv.php
6 days ago
ssdeep.php
6 days ago
ssh2.php
6 days ago
stream.php
6 days ago
strings.php
6 days ago
swoole.php
6 days ago
uodbc.php
6 days ago
uopz.php
6 days ago
url.php
6 days ago
var.php
6 days ago
xdiff.php
6 days ago
xml.php
6 days ago
xmlrpc.php
6 days ago
yaml.php
6 days ago
yaz.php
6 days ago
zip.php
6 days ago
zlib.php
6 days ago
errorfunc.php
82 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePressVendor\Safe; |
| 4 | |
| 5 | use ProfilePressVendor\Safe\Exceptions\ErrorfuncException; |
| 6 | /** |
| 7 | * Sends an error message to the web server's error log or to a file. |
| 8 | * |
| 9 | * @param string $message The error message that should be logged. |
| 10 | * @param int $message_type Says where the error should go. The possible message types are as |
| 11 | * follows: |
| 12 | * |
| 13 | * |
| 14 | * error_log log types |
| 15 | * |
| 16 | * |
| 17 | * |
| 18 | * 0 |
| 19 | * |
| 20 | * message is sent to PHP's system logger, using |
| 21 | * the Operating System's system logging mechanism or a file, depending |
| 22 | * on what the error_log |
| 23 | * configuration directive is set to. This is the default option. |
| 24 | * |
| 25 | * |
| 26 | * |
| 27 | * 1 |
| 28 | * |
| 29 | * message is sent by email to the address in |
| 30 | * the destination parameter. This is the only |
| 31 | * message type where the fourth parameter, |
| 32 | * extra_headers is used. |
| 33 | * |
| 34 | * |
| 35 | * |
| 36 | * 2 |
| 37 | * |
| 38 | * No longer an option. |
| 39 | * |
| 40 | * |
| 41 | * |
| 42 | * 3 |
| 43 | * |
| 44 | * message is appended to the file |
| 45 | * destination. A newline is not automatically |
| 46 | * added to the end of the message string. |
| 47 | * |
| 48 | * |
| 49 | * |
| 50 | * 4 |
| 51 | * |
| 52 | * message is sent directly to the SAPI logging |
| 53 | * handler. |
| 54 | * |
| 55 | * |
| 56 | * |
| 57 | * |
| 58 | * |
| 59 | * @param string $destination The destination. Its meaning depends on the |
| 60 | * message_type parameter as described above. |
| 61 | * @param string $extra_headers The extra headers. It's used when the message_type |
| 62 | * parameter is set to 1. |
| 63 | * This message type uses the same internal function as |
| 64 | * mail does. |
| 65 | * @throws ErrorfuncException |
| 66 | * |
| 67 | */ |
| 68 | function error_log(string $message, int $message_type = 0, string $destination = null, string $extra_headers = null): void |
| 69 | { |
| 70 | error_clear_last(); |
| 71 | if ($extra_headers !== null) { |
| 72 | $result = \error_log($message, $message_type, $destination, $extra_headers); |
| 73 | } elseif ($destination !== null) { |
| 74 | $result = \error_log($message, $message_type, $destination); |
| 75 | } else { |
| 76 | $result = \error_log($message, $message_type); |
| 77 | } |
| 78 | if ($result === \false) { |
| 79 | throw ErrorfuncException::createFromPhpError(); |
| 80 | } |
| 81 | } |
| 82 |