This library is designed to parse popular web application configuration files to extract database connection information for use in other applications or scripts.
To get started, simply require the library:
Then, simply create a new instance of the class specifying which application you're collecting information from (note that the library expects the config file to be located in the directory the executing file is running from):
sleuth = DatabaseSleuth.new(:joomla) sleuth.find_db_info sleuth.dbhost #=> mysql.example.com sleuth.dbname #=> somedbname sleuth.dbuser #=> someusername sleuth.dbpass #=> somepassword sleuth.manual_connection_string #=> mysql -u someusername -psomepassword -h mysql.example.com somedbname
Currently, the following applications are supported:
Copyright © 2010 Joel Watson. See LICENSE for details.