Welcome Guest, Not a member yet? Register   Sign In
getting error because of using php 7.2?
#7

(This post was last modified: 12-09-2019, 09:28 PM by John_Betong.)

Here are two CodeIgniter4 declare(strict_types=1); modifications that may be relevant.

The changes were necessary to connect to the MySQLi database:

file: system/Database/Query.php
PHP Code:
public function getStartTime(bool $returnRaw falseint $decimals 6): string
{
  if ($returnRaw)
  {
    # JOHN MODIFIED
    # return $this->startTime;
    return number_format($this->startTime$decimals);
  }

  return number_format($this->startTime$decimals);


file: system/Database/MySQLi/Connection.php
Code:
public function connect(bool $persistent = false)
{
// Do we have a socket path?
if ($this->hostname[0] === '/')
{
  $hostname = null;
  $port     = null;
  $socket   = $this->hostname;
}
else
{
  $hostname = ($persistent === true) ? 'p:' . $this->hostname : $this->hostname;
  $port     = empty($this->port) ? null : $this->port;
  # JOHN MODIFIED
  # $socket = null;
  $socket   = '';
}
Reply


Messages In This Thread
RE: getting error because of using php 7.2? - by John_Betong - 12-09-2019, 09:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB