1. Go to this page and download the library: Download appwrite/sdk-generator 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/ */
appwrite / sdk-generator example snippets
ppwrite\SDK\SDK;
use Appwrite\SDK\Language\PHP;
use Utopia\OpenAPI\Parser;
// Parse an OpenAPI 2, 3.0, or 3.1 document into the canonical specification model.
// One document covers every SDK platform; the SDK selects its own below.
$version = '2.0.x';
$platform = 'server';
$content = file_get_contents("https://raw.githubusercontent.com/appwrite/specs/main/specs/{$version}/open-api3-{$version}.json");
$spec = Parser::parse($content);
// Create language instance
$lang = new PHP();
$lang // Set language or platform specific options
->setComposerPackage('my-api')
->setComposerVendor('my-company')
;
// Create the SDK object with the language and spec instances
$sdk = new SDK($lang, $spec);
$sdk
->setPlatform($platform) // Keep the operations, aliases and security schemes available to this platform
->setCoverImage('https://github.com/appwrite/appwrite/raw/main/public/images/github.png')
->setLicenseContent('License content here.')
->setVersion('v1.1.0')
;
$sdk->generate(__DIR__ . '/examples/php'); // Generate source code