public function registerShard($shard_name, $parameters)
    {
        if (empty($shard_name)) {
            throw new \Exception("The shard name is not specified!");
        }
        
        if (!empty($this->shard_table[$shard_name])) {
            throw new \Exception("The shard '$shard_name' has been already registered!");
        }
        
        $this->shard_table[$shard_name]["parameters"] = $parameters;
        
        return true;
    }
public function registerShard($shard_name, $parameters)
    {
        if (empty($shard_name)) {
            throw new \Exception("The shard name is not specified!");
        }
        
        if (!empty($this->shard_table[$shard_name])) {
            throw new \Exception("The shard '$shard_name' has been already registered!");
        }
        
        $this->shard_table[$shard_name]["parameters"] = $parameters;
        
        return true;
    }
public function registerShard ( $ shard_name , $ parameters ) { if ( empty ( $ shard_name ) ) { throw new \ Exception ( "The shard name is not specified!" ) ; } if ( ! empty ( $ this -> shard_table [ $ shard_name ] ) ) { throw new \ Exception ( "The shard '$shard_name' has been already registered!" ) ; } $ this -> shard_table [ $ shard_name ] [ "parameters" ] = $ parameters ; return true ; }
Registers a new shard.

@param string $shard_name
Unique shard name.

@param array $parameters
The connection parameters to the shard as an associative array in the form key => value:

- $parameters["db_type"] - type of the database (MySQL or MSSQL)

- $parameters["db_server"] - server address

- $parameters["db_name"] - database name

- $parameters["db_user"] - user name

- $parameters["db_password"] - user password

- $parameters["autoconnect"] - should true if the connection should be established automatically
upon creation.

- $parameters["read_only"] - this paramter sets the connection to the read only mode.

@return boolean
It should return true if the registering was successful, otherwise false.

@throws \Exception
It might throw an exception in the case of any errors:

- if the shard name is not specified.
- if the shard name has been already registered.

@author Oleg Schildt
Registers a new shard .