1: <?php
2: namespace Peridot\WebDriverManager\OS;
3:
4: /**
5: * System determines information about the operating system.
6: *
7: * @package Peridot\WebDriverManager\OS
8: */
9: class System implements SystemInterface
10: {
11: /**
12: * Darwin pattern
13: *
14: * @var string
15: */
16: private static $darwin = '/^dar/i';
17:
18: /**
19: * Windows
20: *
21: * @var string
22: */
23: private static $windows = '/^win/i';
24:
25: /**
26: * {@inheritdoc}
27: *
28: * @return bool
29: */
30: public function isMac()
31: {
32: return preg_match(self::$darwin, PHP_OS);
33: }
34:
35: /**
36: * {@inheritdoc}
37: *
38: * @return bool
39: */
40: public function isWindows()
41: {
42: return preg_match(self::$windows, PHP_OS);
43: }
44:
45: /**
46: * {@inheritdoc}
47: *
48: * @return bool
49: */
50: public function isLinux()
51: {
52: $notMac = ! $this->isMac();
53: $notWindows = ! $this->isWindows();
54:
55: return $notMac && $notWindows;
56: }
57:
58: /**
59: * {@inheritdoc}
60: *
61: * @return bool
62: */
63: public function is64Bit()
64: {
65: return PHP_INT_SIZE === 8;
66: }
67: }
68: