I am new to the forum and well have some questions I hope someone can answer..
1. Classes - static vs instantiated
I've written an app which uses abstract classes (by design) and I also implemented an autoloading of the the classes, is there anything inherently 'bad' or 'wrong' in doing that?
2. Program specifc variables and constants
Within said program I have config options ie folder locations, filenames, etc. I am storing these variables in $_SESSIONS['config'], is there a better way of doing this ..?
3. Registry
A registry class is being used to access the previously mentioned configs in that none of the other functions/methods accesses this data directly.. bad/good?
4. Class within a class
I have the need to parse files, I'd like to be able to load multiple files to be parsed.. my thought was to create a class to handle all the manipulation this was my idea ..
Code: Select all
abstract class loadfiles{
static $Loaded;
function helper($handle){
if(!is_object(self::$Loaded[$handle])){
include('helper_class.php');
return new helper();
} else return self::$Loaded[$handle];
}
function load_handle($files){
if(!is_array($files) return;
foreach($files as $k){
self::$Loaded[$k] = self::helper($k);
}
}
}