src/Neevo/Connection.php
protected function setDriver($driver){
		if(strcasecmp($driver, 'sqlite') === 0) // Backward compatibility
			$driver = 'SQLite2';

		$class = "Neevo\\Drivers\\{$driver}Driver";

		if(!class_exists($class)){
			$file = __DIR__ . '/Drivers/' . strtolower($driver) . '.php';
			if(!file_exists($file))
				throw new DriverException("$driver driver file ($file) does not exist.");
			if(is_readable($file))
				include_once $file;
			else
				throw new DriverException("$driver driver file ($file) is not readable.");
		}
		if(!$this->isDriver($class))
			throw new DriverException("Class '$class' is not a valid Neevo driver class.");

		$this->driver = new $class;

		// Set statement parser
		if($this->isParser($class))
			$this->parser = $class;
	}
protected function setDriver($driver){
		if(strcasecmp($driver, 'sqlite') === 0) // Backward compatibility
			$driver = 'SQLite2';

		$class = "Neevo\\Drivers\\{$driver}Driver";

		if(!class_exists($class)){
			$file = __DIR__ . '/Drivers/' . strtolower($driver) . '.php';
			if(!file_exists($file))
				throw new DriverException("$driver driver file ($file) does not exist.");
			if(is_readable($file))
				include_once $file;
			else
				throw new DriverException("$driver driver file ($file) is not readable.");
		}
		if(!$this->isDriver($class))
			throw new DriverException("Class '$class' is not a valid Neevo driver class.");

		$this->driver = new $class;

		// Set statement parser
		if($this->isParser($class))
			$this->parser = $class;
	}
protected function setDriver ( $ driver ) { if ( strcasecmp ( $ driver , 'sqlite' ) === 0 ) // Backward compatibility $ driver = 'SQLite2' ; $ class = "Neevo\\Drivers\\{$driver}Driver" ; if ( ! class_exists ( $ class ) ) { $ file = __DIR__ . '/Drivers/' . strtolower ( $ driver ) . '.php' ; if ( ! file_exists ( $ file ) ) throw new DriverException ( "$driver driver file ($file) does not exist." ) ; if ( is_readable ( $ file ) ) include_once $ file ; else throw new DriverException ( "$driver driver file ($file) is not readable." ) ; } if ( ! $ this -> isDriver ( $ class ) ) throw new DriverException ( "Class '$class' is not a valid Neevo driver class." ) ; $ this -> driver = new $ class ; // Set statement parser if ( $ this -> isParser ( $ class ) ) $ this -> parser = $ class ; }
Sets the driver and statement parser.
@param string $driver
@throws DriverException
Sets the driver and statement parser .