cylab / php-guacamole-api
2.0.1
2022-05-17 13:54 UTC
Requires
- illuminate/database: ^6.0
Requires (Dev)
- enlightn/security-checker: ^1.9
- insolita/unused-scanner: ^2.3
- phpstan/phpstan: ^1.6
- phpunit/phpunit: ^8.3
- squizlabs/php_codesniffer: ^3.4
- vlucas/phpdotenv: ^3.6
README
PHP library to configure the Apache Guacamole remote desktop gateway.
Installation and usage
composer require cylab/php-guacamole-api
require_once "vendor/autoload.php";
use \Cylab\Guacamole\Guacamole;
use \Cylab\Guacamole\User;
use \Cylab\Guacamole\Connection;
Guacamole::connect($host, $username, $password);
$user = new User();
$user->setUsername("testuser");
$user->setPassword("passw0rd");
$user->save();
$connection = new Connection;
$connection->setName("Linux Desktop");
$connection->setProtocol(Connection::RDP);
$connection->setHost("127.0.0.1");
$connection->setPort(3389);
$connection->save();
$user->addConnection($connection);
foreach (User::all() as $u) {
echo $u->getId() . " : " . $u->getUsername() . "\n";
}
foreach ($user->connections as $c) {
echo $c->getId . "\n";
}
Contributing and testing
To run the tests, php-guacamole-api expects a running guacamole instance.
To run the unit tests, you can use the provided docker-compose.yaml to run a MySQL container that will simulate guacamole:
cp env.docker .env
docker-compose up
./vendor/bin/phpunit