naming fixes while reviewing

remotes/origin/create-share-target-reuse
Thomas Müller 2015-01-26 12:59:25 +07:00
parent 039397bd31
commit 9ad9d7bfbb
3 changed files with 21 additions and 19 deletions

@ -282,17 +282,17 @@ class ConvertType extends Command {
protected function saveDBInfo(InputInterface $input) { protected function saveDBInfo(InputInterface $input) {
$type = $input->getArgument('type'); $type = $input->getArgument('type');
$username = $input->getArgument('username'); $username = $input->getArgument('username');
$dbhost = $input->getArgument('hostname'); $dbHost = $input->getArgument('hostname');
$dbname = $input->getArgument('database'); $dbName = $input->getArgument('database');
$password = $input->getOption('password'); $password = $input->getOption('password');
if ($input->getOption('port')) { if ($input->getOption('port')) {
$dbhost .= ':'.$input->getOption('port'); $dbHost .= ':'.$input->getOption('port');
} }
$this->config->setSystemValues([ $this->config->setSystemValues([
'dbtype' => $type, 'dbtype' => $type,
'dbname' => $dbname, 'dbname' => $dbName,
'dbhost' => $dbhost, 'dbhost' => $dbHost,
'dbuser' => $username, 'dbuser' => $username,
'dbpassword' => $password, 'dbpassword' => $password,
]); ]);

@ -35,22 +35,24 @@ abstract class AbstractDatabase {
} }
public function initialize($config) { public function initialize($config) {
$dbuser = $config['dbuser']; $dbUser = $config['dbuser'];
$dbpass = $config['dbpass']; $dbPass = $config['dbpass'];
$dbname = $config['dbname']; $dbName = $config['dbname'];
$dbhost = !empty($config['dbhost']) ? $config['dbhost'] : 'localhost'; $dbHost = !empty($config['dbhost']) ? $config['dbhost'] : 'localhost';
$dbtableprefix = isset($config['dbtableprefix']) ? $config['dbtableprefix'] : 'oc_'; $dbTablePrefix = isset($config['dbtableprefix']) ? $config['dbtableprefix'] : 'oc_';
\OC_Config::setValues([ \OC_Config::setValues([
'dbname' => $dbname, 'dbname' => $dbName,
'dbhost' => $dbhost, 'dbhost' => $dbHost,
'dbtableprefix' => $dbtableprefix, 'dbtableprefix' => $dbTablePrefix,
]); ]);
$this->dbuser = $dbuser; $this->dbuser = $dbUser;
$this->dbpassword = $dbpass; $this->dbpassword = $dbPass;
$this->dbname = $dbname; $this->dbname = $dbName;
$this->dbhost = $dbhost; $this->dbhost = $dbHost;
$this->tableprefix = $dbtableprefix; $this->tableprefix = $dbTablePrefix;
} }
abstract public function setupDatabase($userName);
} }

@ -5,7 +5,7 @@ namespace OC\Setup;
class MSSQL extends AbstractDatabase { class MSSQL extends AbstractDatabase {
public $dbprettyname = 'MS SQL Server'; public $dbprettyname = 'MS SQL Server';
public function setupDatabase() { public function setupDatabase($username) {
//check if the database user has admin right //check if the database user has admin right
$masterConnectionInfo = array( "Database" => "master", "UID" => $this->dbuser, "PWD" => $this->dbpassword); $masterConnectionInfo = array( "Database" => "master", "UID" => $this->dbuser, "PWD" => $this->dbpassword);