[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/config/response/ -> PhabricatorConfigResponse.php (source)

   1  <?php
   2  
   3  final class PhabricatorConfigResponse extends AphrontHTMLResponse {
   4  
   5    private $view;
   6  
   7    public function setView(PhabricatorSetupIssueView $view) {
   8      $this->view = $view;
   9      return $this;
  10    }
  11  
  12    public function buildResponseString() {
  13      // Check to make sure we aren't requesting this via ajax or conduit
  14      if (isset($_REQUEST['__ajax__']) || isset($_REQUEST['__conduit__'])) {
  15        // We don't want to flood the console with html, just return a simple
  16        // message for now.
  17        return pht(
  18          'This install has a fatal setup error, access the internet web '.
  19          'version to view details and resolve it.');
  20      }
  21  
  22      $resources = $this->buildResources();
  23  
  24      $view = $this->view->render();
  25  
  26      return hsprintf(
  27        '<!DOCTYPE html>'.
  28        '<html>'.
  29          '<head>'.
  30            '<meta charset="UTF-8" />'.
  31            '<title>Phabricator Setup</title>'.
  32            '%s'.
  33          '</head>'.
  34          '<body class="setup-fatal">%s</body>'.
  35        '</html>',
  36        $resources,
  37        $view);
  38    }
  39  
  40    private function buildResources() {
  41      $css = array(
  42        'application/config/config-template.css',
  43        'application/config/setup-issue.css',
  44      );
  45  
  46      $webroot = dirname(phutil_get_library_root('phabricator')).'/webroot/';
  47  
  48      $resources = array();
  49      foreach ($css as $path) {
  50        $resources[] = phutil_tag(
  51          'style',
  52          array('type' => 'text/css'),
  53          phutil_safe_html(Filesystem::readFile($webroot.'/rsrc/css/'.$path)));
  54      }
  55      return phutil_implode_html("\n", $resources);
  56    }
  57  
  58  
  59  }


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