My Function &GetClass Gives The Following Error
Notice: Only variable references should be returned by reference in C:\DarkShipWoW\PAID\WowFireStorm\includes\include.php on line 33
Code On Page.
<?php
/*
* (C) Copyright By 2k9lestaa4lyf@live.co.uk
* Coding For Fun (:
*/
session_start();
$cDir = dirname(__FILE__).'/';
define("ROOT_DIR", $cDir."../", true);
define("LIB_DIR", $cDir."libary/", true);
define("CONFIG_DIR", $cDir."config/", true);
unset($cDir);
function loadLib($lib_name, $lib_dir=LIB_DIR){
$file = $lib_dir.$lib_name.'.php';
if(file_exists($file)){
include $file;
return;
}else{
return 'Invalid;';
}
}
function &GetClass($class_name, $dir=LIB_DIR){
if(class_exists($class_name)){
$C = new $class_name;
return $C;
}else{
loadLib('class.'.$class_name, $dir);
if(class_exists($class_name)){
$C = new $class_name;
return $C;
}
}
return false;
}
function genPass($length=6) {
$password = '';
$possible = '23456789bcdfghjkmnpqrstvwxyz';
$i = 0;
while ($i < $length) {
$password .= substr($possible, mt_rand(0, strlen($possible)-1), 1);
$i++;
}
return $password;
}
function loadClass($class_name, $dir=LIB_DIR){
if(class_exists($class_name)){
return;
}else{
loadLib('class.'.$class_name, $dir);
if(class_exists($class_name)){
return;
}
}
return false;
}
function &returnConfig ($file){
$file = CONFIG_DIR.$file;
if(file_exists($file)){
$filE = parse_ini_file($file);
return $filE;
}else{
return array('');
}
}
loadClass('SESSION');
loadLib('common.defines');
loadClass('mysqli_db');
$GLOBALS['DB'] = new mysqli_db (
$GLOBALS['DB_VARS']['database_hostname'],
$GLOBALS['DB_VARS']['database_username'],
$GLOBALS['DB_VARS']['database_password'],
$GLOBALS['DB_VARS']['database_logon_name']
);
$GLOBALS['DB_WORLD'] = new mysqli_db (
$GLOBALS['DB_VARS']['database_hostname'],
$GLOBALS['DB_VARS']['database_username'],
$GLOBALS['DB_VARS']['database_password'],
$GLOBALS['DB_VARS']['database_world_name']
);
?>
Any Help Would Be Nice, Thanks In Advanced (: