Skip to content

Instantly share code, notes, and snippets.

@kaiohken1982
Created July 26, 2013 10:38
Show Gist options
  • Save kaiohken1982/6087916 to your computer and use it in GitHub Desktop.
Save kaiohken1982/6087916 to your computer and use it in GitHub Desktop.
ZFTool Is64Bit test on 64Bit Windows OS with 32Bit Apache
<?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));
}
}
@Thinkscape
Copy link

Does this winmgmts call also work without admin rights ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment