GrumPHP\Util\Platform::isWindows PHP Метод

isWindows() публичный статический Метод

public static isWindows ( ) : boolean
Результат boolean Whether the host machine is running a Windows OS
    public static function isWindows()
    {
        return defined('PHP_WINDOWS_VERSION_BUILD');
    }

Usage Example

Пример #1
0
 /**
  * @param Process $process
  *
  * @throws \GrumPHP\Exception\PlatformException
  */
 private function guardWindowsCmdMaxInputStringLimitation(Process $process)
 {
     if (!Platform::isWindows()) {
         return;
     }
     if (strlen($process->getCommandLine()) <= Platform::WINDOWS_COMMANDLINE_STRING_LIMITATION) {
         return;
     }
     $this->io->write('', true);
     $this->io->write('<fg=yellow>Oh no, we hit the windows cmd input limit!</fg=yellow>', true);
     $this->io->write('<fg=yellow>Skipping task ...</fg=yellow>');
     throw PlatformException::commandLineStringLimit($process);
 }
Platform