[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/config/controller/ -> PhabricatorConfigDatabaseController.php (source)

   1  <?php
   2  
   3  abstract class PhabricatorConfigDatabaseController
   4    extends PhabricatorConfigController {
   5  
   6    protected function buildSchemaQuery() {
   7      $conf = PhabricatorEnv::newObjectFromConfig(
   8        'mysql.configuration-provider',
   9        array($dao = null, 'w'));
  10  
  11      $api = id(new PhabricatorStorageManagementAPI())
  12        ->setUser($conf->getUser())
  13        ->setHost($conf->getHost())
  14        ->setPort($conf->getPort())
  15        ->setNamespace(PhabricatorLiskDAO::getDefaultStorageNamespace())
  16        ->setPassword($conf->getPassword());
  17  
  18      $query = id(new PhabricatorConfigSchemaQuery())
  19        ->setAPI($api);
  20  
  21      return $query;
  22    }
  23  
  24    protected function renderIcon($status) {
  25      switch ($status) {
  26        case PhabricatorConfigStorageSchema::STATUS_OKAY:
  27          $icon = 'fa-check-circle green';
  28          break;
  29        case PhabricatorConfigStorageSchema::STATUS_WARN:
  30          $icon = 'fa-exclamation-circle yellow';
  31          break;
  32        case PhabricatorConfigStorageSchema::STATUS_FAIL:
  33        default:
  34          $icon = 'fa-times-circle red';
  35          break;
  36      }
  37  
  38      return id(new PHUIIconView())
  39        ->setIconFont($icon);
  40    }
  41  
  42    protected function renderAttr($attr, $issue) {
  43      if ($issue) {
  44        return phutil_tag(
  45          'span',
  46          array(
  47            'style' => 'color: #aa0000;',
  48          ),
  49          $attr);
  50      } else {
  51        return $attr;
  52      }
  53    }
  54  
  55    protected function renderBoolean($value) {
  56      if ($value === null) {
  57        return '';
  58      } else if ($value === true) {
  59        return pht('Yes');
  60      } else {
  61        return pht('No');
  62      }
  63    }
  64  
  65    protected function buildHeaderWithDocumentationLink($title) {
  66  
  67      $doc_link = PhabricatorEnv::getDoclink('Managing Storage Adjustments');
  68  
  69      return id(new PHUIHeaderView())
  70        ->setHeader($title)
  71        ->addActionLink(
  72          id(new PHUIButtonView())
  73            ->setTag('a')
  74            ->setIcon(
  75              id(new PHUIIconView())
  76                ->setIconFont('fa-book'))
  77            ->setHref($doc_link)
  78            ->setText(pht('Learn More')));
  79    }
  80  
  81  }


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