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