Bolt\Exception\LowLevelDatabaseException::missingDriver PHP Method

missingDriver() public static method

public static missingDriver ( $name, $driver )
    public static function missingDriver($name, $driver)
    {
        return new static(sprintf('%s was selected as the database type, but the driver does not exist or is not loaded. ' . 'Please install the %s driver.', $name, $driver));
    }

Usage Example

Example #1
0
 protected function doDatabaseSqliteCheck($config)
 {
     if (!$this->sqliteLoaded) {
         throw LowLevelDatabaseException::missingDriver('SQLite', 'pdo_sqlite');
     }
     // If in-memory connection, skip path checks
     if (isset($config['memory']) && $config['memory'] === true) {
         return;
     }
     // If the file is present, make sure it is writable
     $file = $config['path'];
     if (file_exists($file)) {
         if (!is_writable($file)) {
             throw LowLevelDatabaseException::unwritableFile($file);
         }
         return;
     }
     // If the file isn't present, make sure the directory
     // exists and is writable so the file can be created
     $dir = dirname($file);
     if (!file_exists($dir)) {
         throw LowLevelDatabaseException::nonexistantFolder($dir);
     }
     if (!is_writable($dir)) {
         throw LowLevelDatabaseException::unwritableFolder($dir);
     }
 }
All Usage Examples Of Bolt\Exception\LowLevelDatabaseException::missingDriver