I'm having trouble getting my database to connect.
The documentation only lists a single db config file in config/db.php
Yet the default installation has both a development and production subset of db.php
I'm trying various combinations of those from the docs and the default from initial installation, without success.
1) Can someone give an example of the MySQL db configuration files? Or point me at a tutorial that matches Ver. 1.2.1?
2) The usage of the DB class, from the documentation, shows calls using this format:
DB::somefunction()...
However the usage shown in other places, shows the use of a backslash on the call:
\DB::somefunction()...
I'm not clear on which is correct for FuelPHP Ver 1.2.1
Since I've not gotten a connection to work, I've not been able to test either format.
Thanks
FuelPHP supports multiple environments, which are folders in the app/config directory. You should use these, and not modify config/db.php, which only contains some defaults.
When an environment is loaded, config/db.php and config/<environment>/db.php are merged to form the complete configuration file.
You can check how it's done in our Depot application, http://github.com/fuel/depot.
The backslash defines the namespace. FuelPHP is fully namespaced. By default your App classes live in the global namespace, and All FuelPHP Core modules are aliased to the global namespace from \Fuel\Core.
If you call a class in the same namespace, you don't have to prefix it. If the class is in another namespace, you have. I always use the backslash, out of habit. Try to read up on namespaces to understand how this works.