Created
July 26, 2013 10:38
-
-
Save kaiohken1982/6087916 to your computer and use it in GitHub Desktop.
ZFTool Is64Bit test on 64Bit Windows OS with 32Bit Apache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Test; | |
use ZFTool\Diagnostics\Test\AbstractTest; | |
use ZFTool\Diagnostics\Result\Success; | |
use ZFTool\Diagnostics\Result\Failure; | |
use ZFTool\Diagnostics\Result\Warning; | |
class Is64Bit | |
extends AbstractTest | |
{ | |
public function run() | |
{ | |
$expected = '64 bit'; | |
$architecture = ''; | |
$obj = new \COM('winmgmts://localhost/root/CIMV2'); | |
$wmi = $obj->ExecQuery('Select * from Win32_OperatingSystem'); | |
foreach($wmi as $wmiCall) { | |
$architecture = $wmiCall->OSArchitecture; | |
} | |
if ($architecture === $expected) { | |
return new Success('You are on a 64bit system', array($expected)); | |
} | |
return new Failure('You are NOT on a 64bit system', array($expected)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does this winmgmts call also work without admin rights ?