1. Go to this page and download the library: Download michyaraque/g-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
michyaraque / g-php example snippets
PHP\Extension\{Extension, ExtensionInfo, HostInfo};
use GPHP\Protocol\{HMessage, HPacket};
use GPHP\Packets\Outgoing;
use GPHP\Packets\Incoming;
$extInfo = new ExtensionInfo(
title: "My Extension",
description: "A cool PHP extension",
version: "1.0",
author: "You"
);
$ext = new Extension($extInfo);
$ext->onConnect(function (HostInfo $hostInfo) {
echo "Connected to " . $hostInfo->host . "\n";
});
$ext->run();