Skip to content

Commit 0946a5f

Browse files
committed
Adds methods for determining application type
1 parent 17a53c3 commit 0946a5f

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/Objects/MacApplication.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,25 @@ class MacApplication extends \SplFileInfo
99
{
1010
use ShellTrait;
1111

12+
/**
13+
* @return bool
14+
*/
15+
public function isUserApp()
16+
{
17+
return preg_match('#/Users/([^/]+)/Applications#', $this->getPath());
18+
}
19+
20+
/**
21+
* @return bool
22+
*/
23+
public function isSystemApp()
24+
{
25+
return 0 === strpos($this->getPath(), '/System') || 0 === strpos($this->getPath(), '/Library');
26+
}
27+
28+
/**
29+
* @return string|null
30+
*/
1231
public function getCopyright()
1332
{
1433
return $this->getPlistValue('NSHumanReadableCopyright');

0 commit comments

Comments
 (0)