X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/1a8bb56c72ad34cf159e03b97a467e5e35a614c5..6bde4b82ec04ee5a1622220663bcacca2ec301d6:/src/phorkie/Database.php diff --git a/src/phorkie/Database.php b/src/phorkie/Database.php index add38be..1f214e8 100644 --- a/src/phorkie/Database.php +++ b/src/phorkie/Database.php @@ -3,16 +3,33 @@ namespace phorkie; class Database { + public $adapter = null; + public $prefix = '\phorkie\Database_Adapter_Null'; + + public function __construct() + { + if ($GLOBALS['phorkie']['cfg']['elasticsearch'] != '') { + $this->adapter = 'Elasticsearch'; + $this->prefix = '\phorkie\Database_Adapter_Elasticsearch'; + } + } public function getSearch() { - return new Search_Elasticsearch(); + $class = $this->prefix . '_Search'; + return new $class(); } public function getIndexer() { - //FIXME + $class = $this->prefix . '_Indexer'; + return new $class(); } + public function getSetup() + { + $class = $this->prefix . '_Setup'; + return new $class(); + } } ?>