1: <?php
2: require_once(dirname(__FILE__)."/DbQuestion.class.php");
3:
4: abstract class DbFactory {
5:
6: protected $prefix;
7:
8: abstract protected function getClassName();
9:
10: protected function getFileName() {
11: $result = dirname(__FILE__)."/".$this->prefix."/".$this->getClassName().".class.php";
12: return $result;
13: }
14:
15: protected function classExists() {
16: if ( $this->fileExists() ) {
17: require_once($this->getFileName());
18: }
19: return class_exists($this->getClassName());
20: }
21:
22: protected function fileExists() {
23: return file_exists($this->getFileName());
24: }
25: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>