Agora_Driver::__construct PHP Method

__construct() public method

Constructor
public __construct ( $scope, $params )
    public function __construct($scope, $params)
    {
        if (empty($params['db'])) {
            throw new InvalidArgumentException('Missing required connection parameter(s).');
        }
        /* Set parameters. */
        $this->_scope = $scope;
        $this->_db = $params['db'];
        $this->_charset = $params['charset'];
        /* Initialize the Cache object. */
        $this->_cache = $GLOBALS['injector']->getInstance('Horde_Cache');
    }

Usage Example

示例#1
0
 /**
  * Constructor
  */
 public function __construct($scope)
 {
     parent::__construct($scope);
     /* trick table name */
     if ($scope != 'agora') {
         $this->_threads_table = 'agora_messages_' . $scope;
         $this->_forums_table = 'agora_forums_' . $scope;
     }
 }