We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3933b4 commit fb7d9baCopy full SHA for fb7d9ba
src/Objects/MacUser.php
@@ -15,6 +15,8 @@ class MacUser
15
/** @var string */
16
protected $_username;
17
18
+ protected $_realName;
19
+ /** @var string */
20
protected $_dir;
21
22
protected $_library;
@@ -110,6 +112,19 @@ public function getUserName()
110
112
return $this->_username;
111
113
}
114
115
+ /**
116
+ * @return string|null
117
+ */
118
+ public function getRealName()
119
+ {
120
+ if (empty($this->_realName))
121
122
+ $this->_realName = $this->getShellExec("/usr/bin/dscl . -read " . $this->getDir() . " RealName | sed -n 's/^ //g;2p'");
123
+ }
124
+
125
+ return $this->_realName ?? null;
126
127
128
/**
129
* @param string $key The name of the password in the keychain
130
*
0 commit comments