OsInfo.php 568 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework;
  7. /**
  8. * Wrapper on PHP_OS constant
  9. */
  10. class OsInfo
  11. {
  12. /**
  13. * Operation system
  14. *
  15. * @var string
  16. */
  17. protected $os;
  18. /**
  19. * Initialize os
  20. */
  21. public function __construct()
  22. {
  23. $this->os = PHP_OS;
  24. }
  25. /**
  26. * Check id system is Windows
  27. *
  28. * @return bool
  29. */
  30. public function isWindows()
  31. {
  32. return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
  33. }
  34. }