[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/infrastructure/storage/configuration/ -> DefaultDatabaseConfigurationProvider.php (source)

   1  <?php
   2  
   3  final class DefaultDatabaseConfigurationProvider
   4    implements DatabaseConfigurationProvider {
   5  
   6    private $dao;
   7    private $mode;
   8    private $namespace;
   9  
  10    public function __construct(
  11      LiskDAO $dao = null,
  12      $mode = 'r',
  13      $namespace = 'phabricator') {
  14  
  15      $this->dao = $dao;
  16      $this->mode = $mode;
  17      $this->namespace = $namespace;
  18    }
  19  
  20    public function getUser() {
  21      return PhabricatorEnv::getEnvConfig('mysql.user');
  22    }
  23  
  24    public function getPassword() {
  25      return new PhutilOpaqueEnvelope(PhabricatorEnv::getEnvConfig('mysql.pass'));
  26    }
  27  
  28    public function getHost() {
  29      return PhabricatorEnv::getEnvConfig('mysql.host');
  30    }
  31  
  32    public function getPort() {
  33      return PhabricatorEnv::getEnvConfig('mysql.port');
  34    }
  35  
  36    public function getDatabase() {
  37      if (!$this->getDao()) {
  38        return null;
  39      }
  40      return $this->namespace.'_'.$this->getDao()->getApplicationName();
  41    }
  42  
  43    final protected function getDao() {
  44      return $this->dao;
  45    }
  46  
  47  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1