05-18-2009, 08:36 PM
|
#6 (permalink)
|
|
The Acquainted
Join Date: Oct 2007
Posts: 170
Thanks: 18
|
Thanks for the feedback. The first file which gets loaded is init.php:
PHP Code:
<?php // Check if we are local if ($_SERVER['SERVER_ADDR'] == '127.0.0.1') { define('LOCAL', TRUE); } else { define('LOCAL', FALSE); }
// Activate error reporting on local server if (LOCAL) { error_reporting(E_ALL); }
// Include the main functions include_once('library.php');
// Load mandatory class(es) include_once('database.class.php');
// Prepare for autoloading the appropriate classes function __autoload($szClass) { include_once(strtolower($szClass).'.class.php'); }
// Set locale to Dutch setlocale(LC_ALL, 'nl_NL');
// Define the Google Maps API key define('GMAPS_KEY', (LOCAL ? 'ABQIAAAAXRbN4TY9xbY5dw4fbMiPVRQQjDJwdt1aUvnAUED1_0C4Ozpy2hTgmlZavSPTSh4PGmg3dWXDWR79mw' : 'ABQIAAAAXRbN4TY9xbY5dw4fbMiPVRR9LNncnZ2GbBrTPZVxzPxSqrkWtRSSZ078PFurHFpxZZ3lovXlkZukJg'));
// Get the main menu $aMainMenu = Database::get_instance()->select_query('menu', array('id', 'name', 'href'), array('parent_id' => 0), array('rank' => 'ASC'));
// Get the weather details $pWeather = new Weather();
?>
I just made the connect() function private. I will also add a getter/setter to the class instead of relying on a defined global.
Thanks!
|
|
|
|