PHPackages                             magicoli/opensim-rest-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. magicoli/opensim-rest-php

ActiveLibrary[API Development](/categories/api)

magicoli/opensim-rest-php
=========================

OpenSimulator REST PHP library and command-line client

v1.0.6(11mo ago)277AGPL-3.0-or-laterPHP

Since Jul 20Pushed 8mo ago2 watchersCompare

[ Source](https://github.com/GuduleLapointe/opensim-rest-php)[ Packagist](https://packagist.org/packages/magicoli/opensim-rest-php)[ RSS](/packages/magicoli-opensim-rest-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (8)Used By (0)

OpenSimulator REST PHP library and command-line client
======================================================

[](#opensimulator-rest-php-library-and-command-line-client)

[![Version 1.0.6](https://camo.githubusercontent.com/563dd824c5d1d6b1000c9f43b7a85cbbce20cabcd5b662087ee4bdfa6a67c502/68747470733a2f2f62616467656e2e6e65742f62616467652f56657273696f6e2f312e302e362f393939393939)](https://camo.githubusercontent.com/563dd824c5d1d6b1000c9f43b7a85cbbce20cabcd5b662087ee4bdfa6a67c502/68747470733a2f2f62616467656e2e6e65742f62616467652f56657273696f6e2f312e302e362f393939393939)[![Stable 1.0.6](https://camo.githubusercontent.com/ec172111bb28396c0c8b04f078fb82c8930af404f1bed766b1e56b00d8958770/68747470733a2f2f62616467656e2e6e65742f62616467652f537461626c652f312e302e362f303061613030)](https://camo.githubusercontent.com/ec172111bb28396c0c8b04f078fb82c8930af404f1bed766b1e56b00d8958770/68747470733a2f2f62616467656e2e6e65742f62616467652f537461626c652f312e302e362f303061613030)[![Requires PHP 7.4](https://camo.githubusercontent.com/3022a1e3eee4f0e534079af9052ea4acdcf9a4e6496588eb4950df70e9d1480f/68747470733a2f2f62616467656e2e6e65742f62616467652f5048502f372e342b2f373838346266)](https://camo.githubusercontent.com/3022a1e3eee4f0e534079af9052ea4acdcf9a4e6496588eb4950df70e9d1480f/68747470733a2f2f62616467656e2e6e65742f62616467652f5048502f372e342b2f373838346266)[![License AGPLv3](https://camo.githubusercontent.com/0169de2d1127981aaf38b3b9dd5f7e5a30ce40635fde41b18afe2e38d5789d72/68747470733a2f2f62616467656e2e6e65742f62616467652f4c6963656e73652f4147504c76332f353532623535)](https://camo.githubusercontent.com/0169de2d1127981aaf38b3b9dd5f7e5a30ce40635fde41b18afe2e38d5789d72/68747470733a2f2f62616467656e2e6e65742f62616467652f4c6963656e73652f4147504c76332f353532623535)

This library allows to communicate with Robust or OpenSimulator instance with rest console enabled.

It can be used inside a PHP project, or as a command-line client for OpenSimulator grids.

Available commands can be found here: [http://opensimulator.org/wiki/Server\_Commands](http://opensimulator.org/wiki/Server_Commands)

Prerequisites
-------------

[](#prerequisites)

Remote connection must be enabled in your Robust .ini file.

**Do not leave default values!**. You should never need to type username and password manually, so you can safely [generate long random strings](https://www.random.org/strings/?num=2&len=32&digits=on&upperalpha=on&loweralpha=on&unique=on&format=plain&rnd=new).

You must choose a specific port, not already used by another service. It is good practice to limit access to this port to authorized IP addresses only in your firewall settings.

```
[Network]
  ConsoleUser = arandomgeneratedstring
  ConsolePass = anotherrandomgeneratedstring
  ConsolePort = 8009
  ; choose a port not already used by another service
```

Command-line client
-------------------

[](#command-line-client)

[Download the executable](https://raw.githubusercontent.com/magicoli/opensim-rest-php/master/opensim-rest-cli) from this repository, make sure `opensim-rest-cli` is executable and move it to /usr/local/bin/.

```
chmod +x /path/to/opensim-rest-cli
sudo mv /path/to/opensim-rest-cli /usr/local/bin/opensim-rest-cli
```

You can run commands like

```
opensim-rest-cli /path/to/Robust.ini show info
opensim-rest-cli /path/to/Robust.ini show regions
```

If you save the credentials in ~/.opensim-rest-cli.ini, you can skip the Robust.ini argument.

```
opensim-rest-cli show info
opensim-rest-cli show regions
```

PHP class
---------

[](#php-class)

### Method 1: Install with composer (recommended for standalone projects)

[](#method-1-install-with-composer-recommended-for-standalone-projects)

```
composer require magicoli/opensim-rest-php
```

Then in your PHP code:

```
require_once 'vendor/autoload.php';

$session = opensim_rest_session(
  array(
    'uri' => "yourgrid.org:8009",
    'ConsoleUser' => 'yourConsoleUsername',
    'ConsolePass' => 'yourConsolePassword',
  )
);

if ( is_opensim_rest_error($session) ) {
  error_log( "OpenSim_Rest error: " . $session->getMessage() );
} else {
  $responseLines = $session->sendCommand($command);
}

# Return value: an array containing the line(s) of response or a PHP Error
```

### Method 2: Git Submodule + sparse (recommended for integrated projects)

[](#method-2-git-submodule--sparse-recommended-for-integrated-projects)

**Setting sparse config is critical** to avoid executables being accessible on public website.

From your project directory:

```
git submodule add https://github.com/magicoli/opensim-rest-php.git opensim-rest
cd opensim-rest
git config core.sparseCheckout true

echo '*' > $(git rev-parse --git-dir)/info/sparse-checkout
echo '!bin/*' >> $(git rev-parse --git-dir)/info/sparse-checkout
echo '!dev/*' >> $(git rev-parse --git-dir)/info/sparse-checkout
echo '!opensim-rest-cli.php' >> $(git rev-parse --git-dir)/info/sparse-checkout
echo '!composer.lock' >> $(git rev-parse --git-dir)/info/sparse-checkout

git read-tree -m -u HEAD
```

This will give you only the files you need:

```
opensim-rest/
├── class-rest.php
├── composer.json
├── LICENSE
└── README.md

```

Then in your PHP code:

```
require_once dirname(__FILE__) . '/opensim-rest/class-rest.php';
// Same usage as above
```

### Method 3: Manual download (not recommended)

[](#method-3-manual-download-not-recommended)

You won't get updates...

[Download class-rest.php file](https://raw.githubusercontent.com/magicoli/opensim-rest-php/master/class-rest.php) in your project or

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance56

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~129 days

Recently: every ~193 days

Total

7

Last Release

258d ago

Major Versions

v1.0.6 → 3.x-dev2025-09-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/483a1b76001365f5fc14e42fda28cde69af374ac7d341ed3999664218bc16072?d=identicon)[magicoli](/maintainers/magicoli)

---

Top Contributors

[![magicoli](https://avatars.githubusercontent.com/u/1338897?v=4)](https://github.com/magicoli "magicoli (21 commits)")

### Embed Badge

![Health badge](/badges/magicoli-opensim-rest-php/health.svg)

```
[![Health](https://phpackages.com/badges/magicoli-opensim-rest-php/health.svg)](https://phpackages.com/packages/magicoli-opensim-rest-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
