Sitelet https://github.com/phpwintools/wmi-scripting/tree/master/docs
Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

readme.md

home true
heroImage /hero-notext.png
actionText Documentation
actionLink /documentation/

Active Record Querying

Easily Testable

Simple API

Quick Start

Install

:::warning

REQUIREMENTS

>= PHP 7.1

Windows and the com_dotnet extension enabled (available in every Windows PHP release). :::

composer require phpwintools/wmi-scripting

Connections with instantiation

$scripting = new Scripting;

// These connections can be called by name.
$scripting->addConnection('server1', Connection::simple('server1', 'user', 'password'));
$scripting->addConnection('server2', Connection::simple('server2', 'user', 'password'));

$scripting->query('server2')->loggedOnUser()->get();

// This will set 'server1' as the default connection.
$scripting->setDefaultConnection('server1');

// If no connection is referenced then the default connection will be used.
$scripting->query()->loggedOnUser()->get();

Connections with static calls

LoggedOnUser::query(Connection::simple('server1', 'user', 'password'))->get();