* @author Helgi Þormar Þorbjörnsson * @author Lukas Smith * @author Arnaud Limbourg * @author Pierre-Alain Joye * @author Bjoern Kraus * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt * @version CVS: $Id: SQL.php 304421 2010-10-15 13:30:56Z clockwerx $ * @link http://pear.php.net/LiveUser */ /** * Require parent class definition. */ require_once 'LiveUser/Perm/Storage.php'; /** * SQL container for permission handling * * @category authentication * @package LiveUser * @author Lukas Smith * @author Bjoern Kraus * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt * @version Release: @package_version@ * @link http://pear.php.net/LiveUser */ class LiveUser_Perm_Storage_SQL extends LiveUser_Perm_Storage { /** * dsn that was connected to * @var string * @access private */ var $dsn = false; /** * instance of the database backend object. * * @var object * @access private */ var $dbc = false; /** * Database connection options. * * @var object * @access private */ var $options = array(); /** * Table prefix * Prefix for all db tables the container has. * * @var string * @access public */ var $prefix = 'liveuser_'; /** * properly disconnect from resources * * @return bool true on success and false on failure * * @access public */ function disconnect() { if ($this->dsn) { $result = $this->dbc->disconnect(); if (PEAR::isError($result)) { $this->stack->push( LIVEUSER_ERROR, 'exception', array('reason' => $result->getMessage() . '-' . $result->getUserInfo()) ); return false; } $this->dbc = false; } return true; } } ?>