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, 3 months ago) by roma7
Branches: MAIN
CVS tags: HEAD
issue http://db.chgk.info/v2/node/10

    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>