当前位置: 首页>>代码示例>>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;未经允许,请勿转载。