[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/config/check/ -> PhabricatorSetupCheckExtensions.php (source)

   1  <?php
   2  
   3  final class PhabricatorSetupCheckExtensions extends PhabricatorSetupCheck {
   4  
   5    public function getExecutionOrder() {
   6      return 0;
   7    }
   8  
   9    protected function executeChecks() {
  10      // TODO: Make 'mbstring' and 'iconv' soft requirements.
  11      // TODO: Make 'curl' a soft requirement.
  12  
  13      $required = array(
  14        'hash',
  15        'json',
  16        'openssl',
  17        'mbstring',
  18        'iconv',
  19        'ctype',
  20  
  21        // There is a chance we might not need this, but some configurations (like
  22        // OAuth or Amazon SES) will require it. Just mark it 'required' since
  23        // it's widely available and relatively core.
  24        'curl',
  25      );
  26  
  27      $need = array();
  28      foreach ($required as $extension) {
  29        if (!extension_loaded($extension)) {
  30          $need[] = $extension;
  31        }
  32      }
  33  
  34      if (!extension_loaded('mysqli') && !extension_loaded('mysql')) {
  35        $need[] = 'mysqli or mysql';
  36      }
  37  
  38      if (!$need) {
  39        return;
  40      }
  41  
  42      $message = pht('Required PHP extensions are not installed.');
  43  
  44      $issue = $this->newIssue('php.extensions')
  45        ->setIsFatal(true)
  46        ->setName(pht('Missing Required Extensions'))
  47        ->setMessage($message);
  48  
  49      foreach ($need as $extension) {
  50        $issue->addPHPExtension($extension);
  51      }
  52    }
  53  }


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