The `getCred` name is just bad. It doesn't communicate that you're talking about database credentials. A web app can have all sorts of credentials to various services. Also, it doesn't conform to any naming schemes we're using.

Since these are just strings and there is no requirement to perform any calculations, they can live in a global `$settings` or `$config` variable that is available throughout the application. Data is better represented as variables, not functions.

The `$config` variable will be a dictionary, from keys denoting each configuration section. e.g. 'db' will contain values related to the database, 'files' will contain values related to file uploads, etc. Then the 'db' key can point to a value which is a dictionary itself, with keys such as `host`, `user`, `password`:

    $config = array(
        'db' => array(
            'host' => 'sample_host',
            'user' => 'sample_username',
            'password' => 'sample_password'
        ),
        'files' => array(
            'avatar_extensions' => array('jpg', 'jpeg', 'png')
        )
    )

This can be set/returned by the config/config.php file. If you prefer to split out the db config, then make a config/db.php and include it in your main config/config.php like I showed above.