Welcome Guest, Not a member yet? Register   Sign In
Documentation not accurate in Database Forge Class
#2

It only throws if it is in debug mode:
PHP Code:
    public function createDatabase(string $dbNamebool $ifNotExists false): bool
    
{
        if (
$ifNotExists && $this->createDatabaseIfStr === null)
        {
            if (
$this->databaseExists($dbName))
            {
                return 
true;
            }
            
$ifNotExists false;
        }
        
        if (
$this->createDatabaseStr === false)
        {
            if (
$this->db->DBDebug)
            {
                throw new 
DatabaseException('This feature is not available for the database you are using.');
            }

            return 
false;
        }
        elseif (! 
$this->db->query(sprintf($ifNotExists $this->createDatabaseIfStr $this->createDatabaseStr$dbName$this->db->charset$this->db->DBCollat))
        )
        {
            if (
$this->db->DBDebug)
            {
                throw new 
DatabaseException('Unable to create the specified database.');
            }

            return 
false;
        }

        if (! empty(
$this->db->dataCache['db_names']))
        {
            
$this->db->dataCache['db_names'][] = $dbName;
        }

        return 
true;
    } 

This is set in your Database config (e.g. .env, or app/Config/Database.php) and defaults to 'DBDebug'  => (ENVIRONMENT !== 'production')
Reply


Messages In This Thread
RE: Documentation not accurate in Database Forge Class - by MGatner - 11-20-2019, 09:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB