當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Installer::locateExecutableInDefaultPaths方法代碼示例

本文整理匯總了PHP中Installer::locateExecutableInDefaultPaths方法的典型用法代碼示例。如果您正苦於以下問題:PHP Installer::locateExecutableInDefaultPaths方法的具體用法?PHP Installer::locateExecutableInDefaultPaths怎麽用?PHP Installer::locateExecutableInDefaultPaths使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Installer的用法示例。


在下文中一共展示了Installer::locateExecutableInDefaultPaths方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: checkHasGzip

 /**
  * Skip the test if 'gzip' is not in $PATH.
  *
  * @return bool
  */
 protected function checkHasGzip()
 {
     if (self::$hasGzip === null) {
         self::$hasGzip = Installer::locateExecutableInDefaultPaths('gzip') !== false;
     }
     if (!self::$hasGzip) {
         $this->markTestSkipped("Skip test, requires the gzip utility in PATH");
     }
     return self::$hasGzip;
 }
開發者ID:paladox,項目名稱:mediawiki,代碼行數:15,代碼來源:DumpTestCase.php

示例2: __construct

 /**
  * Determine if there is a usable tidy.
  */
 public function __construct($useConfiguration = false)
 {
     global $IP, $wgUseTidy, $wgTidyBin, $wgTidyInternal, $wgTidyConfig, $wgTidyConf, $wgTidyOpts;
     $this->enabled = true;
     if ($useConfiguration) {
         if ($wgTidyConfig !== null) {
             $this->config = $wgTidyConfig;
         } elseif ($wgUseTidy) {
             $this->config = ['tidyConfigFile' => $wgTidyConf, 'debugComment' => false, 'tidyBin' => $wgTidyBin, 'tidyCommandLine' => $wgTidyOpts];
             if ($wgTidyInternal) {
                 $this->config['driver'] = wfIsHHVM() ? 'RaggettInternalHHVM' : 'RaggettInternalPHP';
             } else {
                 $this->config['driver'] = 'RaggettExternal';
             }
         } else {
             $this->enabled = false;
         }
     } else {
         $this->config = ['tidyConfigFile' => "{$IP}/includes/tidy/tidy.conf", 'tidyCommandLine' => ''];
         if (extension_loaded('tidy') && class_exists('tidy')) {
             $this->config['driver'] = wfIsHHVM() ? 'RaggettInternalHHVM' : 'RaggettInternalPHP';
         } else {
             if (is_executable($wgTidyBin)) {
                 $this->config['driver'] = 'RaggettExternal';
                 $this->config['tidyBin'] = $wgTidyBin;
             } else {
                 $path = Installer::locateExecutableInDefaultPaths($wgTidyBin);
                 if ($path !== false) {
                     $this->config['driver'] = 'RaggettExternal';
                     $this->config['tidyBin'] = $wgTidyBin;
                 } else {
                     $this->enabled = false;
                 }
             }
         }
     }
     if (!$this->enabled) {
         $this->config = ['driver' => 'disabled'];
     }
 }
開發者ID:paladox,項目名稱:mediawiki,代碼行數:43,代碼來源:TidySupport.php

示例3: readlineEmulation

 /**
  * Emulate readline()
  * @param $prompt String what to begin the line with, like '> '
  * @return String
  */
 private static function readlineEmulation($prompt)
 {
     $bash = Installer::locateExecutableInDefaultPaths(array('bash'));
     if (!wfIsWindows() && $bash) {
         $retval = false;
         $encPrompt = wfEscapeShellArg($prompt);
         $command = "read -er -p {$encPrompt} && echo \"\$REPLY\"";
         $encCommand = wfEscapeShellArg($command);
         $line = wfShellExec("{$bash} -c {$encCommand}", $retval);
         if ($retval == 0) {
             return $line;
         } elseif ($retval == 127) {
             // Couldn't execute bash even though we thought we saw it.
             // Shell probably spit out an error message, sorry :(
             // Fall through to fgets()...
         } else {
             // EOF/ctrl+D
             return false;
         }
     }
     // Fallback... we'll have no editing controls, EWWW
     if (feof(STDIN)) {
         return false;
     }
     print $prompt;
     return fgets(STDIN, 1024);
 }
開發者ID:nischayn22,項目名稱:mediawiki-core,代碼行數:32,代碼來源:Maintenance.php


注:本文中的Installer::locateExecutableInDefaultPaths方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。