diff --git a/system/Database/BaseConnection.php b/system/Database/BaseConnection.php index a7be7bd2d650..86b1b2353482 100644 --- a/system/Database/BaseConnection.php +++ b/system/Database/BaseConnection.php @@ -49,49 +49,49 @@ abstract class BaseConnection implements ConnectionInterface * * @var string */ - public $DSN; + protected $DSN; /** * Database port * * @var int */ - public $port = ''; + protected $port = ''; /** * Hostname * * @var string */ - public $hostname; + protected $hostname; /** * Username * * @var string */ - public $username; + protected $username; /** * Password * * @var string */ - public $password; + protected $password; /** * Database name * * @var string */ - public $database; + protected $database; /** * Database driver * * @var string */ - public $DBDriver = 'MySQLi'; + protected $DBDriver = 'MySQLi'; /** * Sub-driver @@ -99,21 +99,21 @@ abstract class BaseConnection implements ConnectionInterface * @used-by CI_DB_pdo_driver * @var string */ - public $subdriver; + protected $subdriver; /** * Table prefix * * @var string */ - public $DBPrefix = ''; + protected $DBPrefix = ''; /** * Persistent connection flag * * @var bool */ - public $pConnect = false; + protected $pConnect = false; /** * Debug flag @@ -122,56 +122,56 @@ abstract class BaseConnection implements ConnectionInterface * * @var bool */ - public $DBDebug = false; + protected $DBDebug = false; /** * Should we cache results? * * @var bool */ - public $cacheOn = false; + protected $cacheOn = false; /** * Path to store cache files. * * @var string */ - public $cacheDir; + protected $cacheDir; /** * Character set * * @var string */ - public $charset = 'utf8'; + protected $charset = 'utf8'; /** * Collation * * @var string */ - public $DBCollat = 'utf8_general_ci'; + protected $DBCollat = 'utf8_general_ci'; /** * Swap Prefix * * @var string */ - public $swapPre = ''; + protected $swapPre = ''; /** * Encryption flag/data * * @var mixed */ - public $encrypt = false; + protected $encrypt = false; /** * Compression flag * * @var bool */ - public $compress = false; + protected $compress = false; /** * Strict ON flag @@ -180,14 +180,14 @@ abstract class BaseConnection implements ConnectionInterface * * @var bool */ - public $strictOn; + protected $strictOn; /** * Settings for a failover connection. * * @var array */ - public $failover = []; + protected $failover = []; //-------------------------------------------------------------------- @@ -1740,4 +1740,15 @@ abstract protected function _listTables($constrainByPrefix = false): string; abstract protected function _listColumns(string $table = ''): string; //-------------------------------------------------------------------- + + public function __get($key) + { + if (property_exists($this, $key)) + { + return $this->$key; + } + } + + //-------------------------------------------------------------------- + } diff --git a/system/Database/Database.php b/system/Database/Database.php index 5cea9f1df729..345c0228e67f 100644 --- a/system/Database/Database.php +++ b/system/Database/Database.php @@ -76,7 +76,9 @@ public function load(array $params = [], string $alias) throw new \InvalidArgumentException('You have not selected a database type to connect to.'); } - $className = strpos($params['DBDriver'], '\\') === false ? '\CodeIgniter\Database\\' . $params['DBDriver'] . '\\Connection' : $params['DBDriver'] . '\\Connection'; + $className = strpos($params['DBDriver'], '\\') === false + ? '\CodeIgniter\Database\\' . $params['DBDriver'] . '\\Connection' + : $params['DBDriver'] . '\\Connection'; $class = new $className($params); diff --git a/system/HTTP/Response.php b/system/HTTP/Response.php index 2debd177dc27..86ef2f83f35b 100644 --- a/system/HTTP/Response.php +++ b/system/HTTP/Response.php @@ -72,8 +72,8 @@ class Response extends Message implements ResponseInterface // 1xx: Informational 100 => 'Continue', 101 => 'Switching Protocols', - 102 => 'Processing', // http://www.iana.org/go/rfc2518 - 103 => 'Early Hints', // http://www.ietf.org/rfc/rfc8297.txt + 102 => 'Processing', // http://www.iana.org/go/rfc2518 + 103 => 'Early Hints', // http://www.ietf.org/rfc/rfc8297.txt // 2xx: Success 200 => 'OK', 201 => 'Created', @@ -124,8 +124,8 @@ class Response extends Message implements ResponseInterface 428 => 'Precondition Required', // 1.1; http://www.ietf.org/rfc/rfc6585.txt 429 => 'Too Many Requests', // 1.1; http://www.ietf.org/rfc/rfc6585.txt 431 => 'Request Header Fields Too Large', // 1.1; http://www.ietf.org/rfc/rfc6585.txt - 451 => 'Unavailable For Legal Reasons', // http://tools.ietf.org/html/rfc7725 - 499 => 'Client Closed Request', // http://lxr.nginx.org/source/src/http/ngx_http_request.h#0133 + 451 => 'Unavailable For Legal Reasons', // http://tools.ietf.org/html/rfc7725 + 499 => 'Client Closed Request', // http://lxr.nginx.org/source/src/http/ngx_http_request.h#0133 // 5xx: Server error 500 => 'Internal Server Error', 501 => 'Not Implemented', @@ -137,8 +137,8 @@ class Response extends Message implements ResponseInterface 507 => 'Insufficient Storage', // http://www.iana.org/go/rfc4918 508 => 'Loop Detected', // http://www.iana.org/go/rfc5842 510 => 'Not Extended', // http://www.ietf.org/rfc/rfc2774.txt - 511 => 'Network Authentication Required', // http://www.ietf.org/rfc/rfc6585.txt - 599 => 'Network Connect Timeout Error', // https://httpstatuses.com/599 + 511 => 'Network Authentication Required', // http://www.ietf.org/rfc/rfc6585.txt + 599 => 'Network Connect Timeout Error', // https://httpstatuses.com/599 ]; /**