PHP code example of fairpm / did-manager-wordpress
1. Go to this page and download the library: Download fairpm/did-manager-wordpress 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/ */
fairpm / did-manager-wordpress example snippets
AIR\DID\DIDManager;
use FAIR\DID\PLC\PlcClient;
use FAIR\DID\Storage\KeyStore;
use FAIR\WordPress\DID\Parsers\MetadataGenerator;
use FAIR\WordPress\DID\WordPressDIDManager;
$core = new DIDManager(
new KeyStore(__DIR__ . '/keys.json'),
new PlcClient(),
);
$wordpress = new WordPressDIDManager($core);
$result = $wordpress->create_package_did(__DIR__ . '/my-plugin', 'my-plugin.example.com', null, true);
$metadata = $wordpress->generate_metadata(__DIR__ . '/my-plugin', did: $result['did']);