Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added occ install option for database-port #323

Merged
merged 2 commits into from
Jul 7, 2016
Merged

Added occ install option for database-port #323

merged 2 commits into from
Jul 7, 2016

Conversation

Faldon
Copy link
Contributor

@Faldon Faldon commented Jul 6, 2016

Implemented non-standard database port on occ install

  • Added optional input option --database-port in maintenance:install command
  • Refactored the databases to store the database port as string, defaulting to an empty string
  • Kept parsing hostname for port option in psql and mysql when no port was provided
  • Changed the PostgreSQL connection error message

Tested

  • with MySQL TCP port
  • with MySQL Unix Socket
  • with PostgreSQL

ToDo

  • Testing with Oracle

Solves #271

Extended the database setup to store the database port.
Changed the PostgreSQL connection error message for clarification.
@mention-bot
Copy link

@Faldon, thanks for your PR! By analyzing the annotation information on this pull request, we identified @bartv2, @DeepDiver1975 and @nickvergessen to be potential reviewers

@@ -50,6 +50,7 @@ protected function configure() {
->addOption('database', null, InputOption::VALUE_REQUIRED, 'Supported database type', 'sqlite')
->addOption('database-name', null, InputOption::VALUE_REQUIRED, 'Name of the database')
->addOption('database-host', null, InputOption::VALUE_REQUIRED, 'Hostname of the database', 'localhost')
->addOption('database-port', null, InputOption::VALUE_OPTIONAL, 'Port the database is listening on')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be InputOption::VALUE_REQUIRED

Options are all optional, but when you specify it, it needs a value.

@nickvergessen nickvergessen added enhancement 3. to review Waiting for reviews labels Jul 6, 2016
@nickvergessen nickvergessen added this to the Nextcloud Next milestone Jul 6, 2016
@Faldon
Copy link
Contributor Author

Faldon commented Jul 6, 2016

Ofc, casting to int is much more appropriate. And in case the port was provided with the hostname, addslashes is already executed on the string.

… was provided.

Added casting database port to int for input sanitation in pgsql and oci connections.
@nickvergessen
Copy link
Member

👍

@MorrisJobke
Copy link
Member

Tested and works 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants