private static function determineMethod($disableGrep)
 {
     $finder = new ExecutableFinder();
     $isWindows = 0 === stripos(PHP_OS, 'win');
     $execAvailable = function_exists('exec');
     if (!$isWindows && $execAvailable && !$disableGrep && (self::$grepPath = $finder->find('grep'))) {
         self::$method = self::METHOD_GREP;
     } else {
         if ($isWindows && $execAvailable) {
             self::$method = self::METHOD_FINDSTR;
         } else {
             self::$method = self::METHOD_FINDER;
         }
     }
 }
Example #2
0
 private static function determineMethod()
 {
     $finder = new ExecutableFinder();
     $isWindows = 0 === stripos(PHP_OS, 'win');
     if (!$isWindows && (self::$grepPath = $finder->find('grep'))) {
         self::$method = self::METHOD_GREP;
     } else {
         if ($isWindows) {
             self::$method = self::METHOD_FINDSTR;
         } else {
             self::$method = self::METHOD_FINDER;
         }
     }
 }