null adapter that is used when no search adapter is configured
[phorkie.git] / src / phorkie / Database.php
1 <?php
2 namespace phorkie;
3
4 class Database
5 {
6     public $prefix = '\phorkie\Database_Adapter_Null';
7
8     public function __construct()
9     {
10         if ($GLOBALS['phorkie']['cfg']['elasticsearch'] != '') {
11             $this->prefix = '\phorkie\Database_Adapter_Elasticsearch';
12         }
13     }
14     public function getSearch()
15     {
16         $class = $this->prefix . '_Search';
17         return new $class();
18     }
19
20     public function getIndexer()
21     {
22         $class = $this->prefix . '_Indexer';
23         return new $class();
24     }
25
26     public function getSetup()
27     {
28         $class = $this->prefix . '_Setup';
29         return new $class();
30     }
31 }
32
33 ?>