File:  [Local Repository] / db / prgsrc / drupal / modules / chgk_db / classes / DbFactory.class.php
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Sat Mar 20 17:23:42 2010 UTC (14 years, 1 month ago) by roma7
Branches: MAIN
CVS tags: HEAD
issue http://db.chgk.info/v2/node/10

<?php
require_once(dirname(__FILE__)."/DbQuestion.class.php");

abstract class DbFactory {

  protected $prefix;

  abstract protected function getClassName();
  
  protected function getFileName() {
    $result = dirname(__FILE__)."/".$this->prefix."/".$this->getClassName().".class.php";
    return $result;
  }
  
  protected function classExists() {
    if ( $this->fileExists() ) {
      require_once($this->getFileName());      
    }
    return class_exists($this->getClassName());
  }
  
  protected function fileExists() {
    return file_exists($this->getFileName());
  }
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>