<commit_before><?php

final class PhabricatorDirectoryMainController
  extends PhabricatorDirectoryController {

  private $filter;
  private $minipanels = array();

  public function willProcessRequest(array $data) {
    $this->filter = idx($data, 'filter');
  }

  public function processRequest() {
    $user = $this->getRequest()->getUser();

    if ($this->filter == 'jump') {
      return $this->buildJumpResponse();
    }

    $nav = $this->buildNav();

    $project_query = new PhabricatorProjectQuery();
    $project_query->setViewer($user);
    $project_query->withMemberPHIDs(array($user->getPHID()));
    $projects = $project_query->execute();

    return $this->buildMainResponse($nav, $projects);
  }

  private function buildMainResponse($nav, array $projects) {
    assert_instances_of($projects, 'PhabricatorProject');

    $maniphest = 'PhabricatorApplicationManiphest';
    if (PhabricatorApplication::isClassInstalled($maniphest)) {
      $unbreak_panel = $this->buildUnbreakNowPanel();
      $triage_panel = $this->buildNeedsTriagePanel($projects);
      $tasks_panel = $this->buildTasksPanel();
    } else {
      $unbreak_panel = null;
      $triage_panel = null;
      $tasks_panel = null;
    }

    if (PhabricatorEnv::getEnvConfig('welcome.html') !== null) {
      $welcome_panel = $this->buildWelcomePanel();
    } else {
      $welcome_panel = null;
    }
    $jump_panel = $this->buildJumpPanel();
    $revision_panel = $this->buildRevisionPanel();
    $audit_panel = $this->buildAuditPanel();
    $commit_panel = $this->buildCommitPanel();

    $content = array(
      $jump_panel,
      $welcome_panel,
      $unbreak_panel,
      $triage_panel,
      $revision_panel,
      $tasks_panel,
      $audit_panel,
      $commit_panel,
      $this->minipanels,
    );

    $nav->appendChild($content);
    $nav->appendChild(new PhabricatorGlobalUploadTargetView());

    return $this->buildApplicationPage(
      $nav,
      array(
        'title' => 'Phabricator',
        'device' => true,
      ));
  }<commit_msg>Hide Audit information on Home when the application is uninstalled<commit_after><?php

final class PhabricatorDirectoryMainController
  extends PhabricatorDirectoryController {

  private $filter;
  private $minipanels = array();

  public function willProcessRequest(array $data) {
    $this->filter = idx($data, 'filter');
  }

  public function processRequest() {
    $user = $this->getRequest()->getUser();

    if ($this->filter == 'jump') {
      return $this->buildJumpResponse();
    }

    $nav = $this->buildNav();

    $project_query = new PhabricatorProjectQuery();
    $project_query->setViewer($user);
    $project_query->withMemberPHIDs(array($user->getPHID()));
    $projects = $project_query->execute();

    return $this->buildMainResponse($nav, $projects);
  }

  private function buildMainResponse($nav, array $projects) {
    assert_instances_of($projects, 'PhabricatorProject');

    $maniphest = 'PhabricatorApplicationManiphest';
    if (PhabricatorApplication::isClassInstalled($maniphest)) {
      $unbreak_panel = $this->buildUnbreakNowPanel();
      $triage_panel = $this->buildNeedsTriagePanel($projects);
      $tasks_panel = $this->buildTasksPanel();
    } else {
      $unbreak_panel = null;
      $triage_panel = null;
      $tasks_panel = null;
    }

    $audit = 'PhabricatorApplicationAudit';
    if (PhabricatorApplication::isClassInstalled($audit)) {
      $audit_panel = $this->buildAuditPanel();
      $commit_panel = $this->buildCommitPanel();
    } else {
      $audit_panel = null;
      $commit_panel = null;
    }

    if (PhabricatorEnv::getEnvConfig('welcome.html') !== null) {
      $welcome_panel = $this->buildWelcomePanel();
    } else {
      $welcome_panel = null;
    }

    $jump_panel = $this->buildJumpPanel();
    $revision_panel = $this->buildRevisionPanel();

    $content = array(
      $jump_panel,
      $welcome_panel,
      $unbreak_panel,
      $triage_panel,
      $revision_panel,
      $tasks_panel,
      $audit_panel,
      $commit_panel,
      $this->minipanels,
    );

    $nav->appendChild($content);
    $nav->appendChild(new PhabricatorGlobalUploadTargetView());

    return $this->buildApplicationPage(
      $nav,
      array(
        'title' => 'Phabricator',
        'device' => true,
      ));
  }
{'fraction_non_alphanumeric': 0.14249363867684478, 'fraction_numerical': 0.0, 'mean_word_length': 3.504166666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1221874', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1359, 'n_words': 222}