MydbEnvironment
in package
implements
MydbEnvironmentInterface
Tags
Table of Contents
Interfaces
Properties
- $knownSignals : array<string|int, int>
- $trappedHandlers : array<string|int, mixed>
- Backup of signal handlers Original signal handler, which replaced by custon trap
- $trappedSignals : array<string|int, int>
- Any signals that were trapped during custom signal handler
Methods
- endSignalsTrap() : array<string|int, int>|null
- Disable custom signal handler
- error_reporting() : int
- Sets which PHP errors are reported
- gc_collect_cycles() : void
- ignore_user_abort() : int
- Set whether a client disconnect should abort script execution (does not affect CLI)
- ini_set() : string
- Sets the value of a configuration option
- restore_error_handler() : void
- Restore previous PHP error handler
- set_error_handler() : void
- Set custom PHP error handler
- setMysqlndNetReadTimeout() : bool
- Set mysqlnd.net_read_timeout php ini value
- startSignalsTrap() : void
- Enable custom signal handler
- getNullErrorHandler() : callable
- Error handler that does nothing and does not chain
Properties
$knownSignals
protected
array<string|int, int>
$knownSignals
= [\SIGTERM, \SIGINT, \SIGHUP]
$trappedHandlers
Backup of signal handlers Original signal handler, which replaced by custon trap
protected
array<string|int, mixed>
$trappedHandlers
= []
Tags
$trappedSignals
Any signals that were trapped during custom signal handler
protected
array<string|int, int>
$trappedSignals
= []
Methods
endSignalsTrap()
Disable custom signal handler
public
endSignalsTrap() : array<string|int, int>|null
Tags
Return values
array<string|int, int>|null —array of trapped signals
error_reporting()
Sets which PHP errors are reported
public
error_reporting(int $level) : int
Parameters
- $level : int
Tags
Return values
intgc_collect_cycles()
public
gc_collect_cycles() : void
Tags
ignore_user_abort()
Set whether a client disconnect should abort script execution (does not affect CLI)
public
ignore_user_abort() : int
Tags
Return values
intini_set()
Sets the value of a configuration option
public
ini_set(string $key, string $value) : string
Parameters
- $key : string
- $value : string
Tags
Return values
stringrestore_error_handler()
Restore previous PHP error handler
public
restore_error_handler() : void
Tags
set_error_handler()
Set custom PHP error handler
public
set_error_handler([callable|null $callback = null ][, int $error_levels = E_ALL | E_STRICT ]) : void
Parameters
- $callback : callable|null = null
- $error_levels : int = E_ALL | E_STRICT
Tags
setMysqlndNetReadTimeout()
Set mysqlnd.net_read_timeout php ini value
public
setMysqlndNetReadTimeout(string $timeoutSeconds) : bool
mysqlnd and the MySQL Client Library, libmysqlclient use different networking APIs. mysqlnd uses PHP streams, whereas libmysqlclient uses its own wrapper around the operating level network calls. PHP, by default, sets a read timeout of 60s for streams. This is set via php.ini, default_socket_timeout. This default applies to all streams that set no other timeout value. mysqlnd does not set any other value and therefore connections of long running queries can be disconnected after default_socket_timeout seconds resulting in an error message 2006 - MySQL Server has gone away. The MySQL Client Library sets a default timeout of 24 * 3600 seconds (1 day) and waits for other timeouts to occur, such as TCP/IP timeouts. mysqlnd now uses the same very long timeout. The value is configurable through a new php.ini setting: mysqlnd.net_read_timeout.
mysqlnd.net_read_timeout gets used by any extension (ext/mysql, ext/mysqli, PDO_MySQL) that uses mysqlnd. mysqlnd tells PHP Streams to use mysqlnd.net_read_timeout. Please note that there may be subtle differences between MYSQL_OPT_READ_TIMEOUT from the MySQL Client Library and PHP Streams, for example MYSQL_OPT_READ_TIMEOUT is documented to work only for TCP/IP connections and, prior to MySQL 5.1.2, only for Windows. PHP streams may not have this limitation.
Parameters
- $timeoutSeconds : string
Tags
Return values
boolstartSignalsTrap()
Enable custom signal handler
public
startSignalsTrap() : void
Tags
getNullErrorHandler()
Error handler that does nothing and does not chain
protected
getNullErrorHandler() : callable