Commit 455a6e86 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Changed qfq config from PHP to PHP_INI files

parent 85dc1486
/configUser.php
/qfq.ini
/.idea
/node_modules
/packages
......
<?php
/**
* Created by PhpStorm.
* User: Rafael Ostertag <rafael.ostertag@math.uzh.ch>
* Date: 2/9/15
* Time: 12:45 PM
*/
define('DBUSER', '<USERNAME>');
define('DBSERVER', '<HOST>');
define('DBPW', '<PASSWORD>');
define('DB', '<DEVELOPMENT_DATABASE>');
define('TESTDB', '<TEST_DATABASE>');
?>
<?php
/**
* Created by PhpStorm.
* User: Rafael Ostertag <rafael.ostertag@math.uzh.ch>
* Date: 2/9/15
* Time: 12:45 PM
*/
define('DBUSER', 'crose');
define('DBSERVER', 'localhost');
define('DBPW', 'GWtrLMx67S4wdFBV');
define('DB', 'crose_qfq_jqw');
define('TESTDB', 'crose_qfq_jqw_phpunit');
define('SESSIONNAME', 'qfq');
?>
; comment
DBUSER = <DBUSER>
DBSERVER = <DBSERVER>
DBPW = <DBPW>
DB = <DB>
TESTDB = <TESTDB>
SESSIONNAME = qfq
\ No newline at end of file
; comment
DBUSER = crose
DBSERVER = localhost
DBPW = GWtrLMx67S4wdFBV
DB = crose_qfq_jqw
TESTDB = crose_qfq_jqw_phpunit
SESSIONNAME = qfq
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* @author: crose
* Date: 3/10/15
* Time: 9:48 AM
*
* $Id: efb1ee01c8487b213d49f2576b914cc0ec0dbc66 $
*/
namespace qfq;
/**
* Abstract class for retrieval of configuration options.
*
* @package qfq
*/
abstract class Config {
/**
* Get the PHP Session name
*
* @return string PHP Session name
*/
abstract public function getSessionName();
/**
* Get the database user name
*
* @return string database user name
*/
abstract public function getDatabaseUserName();
/**
* Get the database user password
*
* @return string database user password
*/
abstract public function getDatabaseUserPassword();
/**
* Get the MySQL DSN string.
*
* @return string MySQL DSN string.
*/
public function getMysqlDSNString() {
return 'mysql:host=' . $this->getDatabaseHost() . ';dbname=' . $this->getDatabaseName();
}
/**
* Get the database server host name
*
* @return string host name of the database server
*/
abstract public function getDatabaseHost();
/**
* Get the database name
*
* @return string database name
*/
abstract public function getDatabaseName();
/**
* Get the MySQL DSN string for the test database
*
* @return string MySQL DSN string.
*/
public function getMysqlDSNStringTestDB() {
return 'mysql:host=' . $this->getDatabaseHost() . ';dbname=' . $this->getTestDatabaseName();
}
/**
* Get the test database name
*
* @return string test database name
*/
abstract public function getTestDatabaseName();
}
<?php
/**
* @author Rafael Ostertag <rafael.ostertag@math.uzh.ch>
*/
namespace qfq;
require_once(__DIR__ . '/Config.php');
require_once(__DIR__ . '/../configUser.php');
/**
* Class ConfigFile
*
* Returns the configuration values based on values stored in configUser.php.
* @package qfq
*/
class ConfigFile extends Config {
/**
* Get the PHP Session name
*
* @return string PHP Session name
*/
public function getSessionName() {
return SESSIONNAME;
}
/**
* Get the database server host name
*
* @return string host name of the database server
*/
public function getDatabaseHost() {
return DBSERVER;
}
/**
* Get the database user name
*
* @return string database user name
*/
public function getDatabaseUserName() {
return DBUSER;
}
/**
* Get the database user password
*
* @return string database user password
*/
public function getDatabaseUserPassword() {
return DBPW;
}
/**
* Get the database name
*
* @return string database name
*/
public function getDatabaseName() {
return DB;
}
/**
* Get the test database name
*
* @return string test database name
*/
public function getTestDatabaseName() {
return TESTDB;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment