Skip to content

Commit

Permalink
Windows.php cleanup, removed WMI2 reference (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksandell authored and jrgp committed Oct 9, 2019
1 parent 6f62a62 commit d1a1a34
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Linfo/OS/Windows.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Windows extends OS
// Keep these tucked away
protected $settings;

private $wmi, $wmi2, $windows_version;
private $wmi, $windows_version;

/**
* Constructor. Localizes settings.
Expand All @@ -59,10 +59,7 @@ public function __construct($settings)
// Get WMI instance
$this->wmi = new COM('winmgmts:{impersonationLevel=impersonate}//./root/cimv2');

// Get StandardCimv2 instance
$this->wmi2 = new COM('winmgmts:{impersonationLevel=impersonate}//./root/StandardCimv2');

if (!is_object($this->wmi) || !is_object($this->wmi2)) {
if (!is_object($this->wmi)) {
throw new FatalException('This needs access to WMI. Please enable DCOM in php.ini and allow the current user to access the WMI DCOM object.');
}
}
Expand Down

0 comments on commit d1a1a34

Please sign in to comment.