Location: PHPKode > projects > POP - Persistent Objects for PHP > POP/core/POPDBDriverRegistry.php
<?php

	/**
	 * Class used for creating the database connections for the POP lib
	 * 
	 * @package pop
	 * @subpackage core
	 */
	abstract class POPDBDriverRegistry
	{
		/**
		 * Driver collection
		 * @var array
		 */
		protected static $drivers;
		
		/**
		 * Add a db driver to the collection 
		 * @param $drivername - Name for the driver
		 * @param $driverclassname - Class used as the driver
		 * @return void
		 */
		public static function addDriver($drivername, $driverclassname)
		{
			if (!is_array(self::$drivers))
				self::$drivers = array();
			self::$drivers[$drivername] = new $driverclassname();
		}
		
		/**
		 * Get the driver for use
		 * @param $drivername - Name of the driver
		 * @return string - Name of the class to handle the driver 
		 */
		public static function getDriver($drivername)
		{
			return self::$drivers[$drivername];
		}
		
	}
?>
Return current item: POP - Persistent Objects for PHP