PHP code example of ernestmarcinko / waifuvault-php-api
1. Go to this page and download the library: Download ernestmarcinko/waifuvault-php-api 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/ */
ernestmarcinko / waifuvault-php-api example snippets
use ErnestMarcinko\WaifuVault\WaifuApi;
$waifu = new WaifuApi();
$contents = $waifu->getFile(array(
'filename' => '/1710111505084/08.png'
));
var_dump($contents);
use ErnestMarcinko\WaifuVault\WaifuApi;
$waifu = new WaifuApi();
$response = $waifu->modifyEntry(array(
'token' => 'token',
'password' => 'apple'
));
var_dump($response->protected);
use ErnestMarcinko\WaifuVault\WaifuApi;
$waifu = new WaifuApi();
$response = $waifu->modifyEntry(array(
'token' => 'token',
'password' => 'newPass'
'previousPassword' => 'apple'
));
var_dump($response->protected);
use ErnestMarcinko\WaifuVault\WaifuApi;
$waifu = new WaifuApi();
$response = $waifu->modifyEntry(array(
'token' => 'token',
'customExpiry' => "1d"
));
var_dump($response->retentionPeriod);
use ErnestMarcinko\WaifuVault\WaifuApi;
$waifu = new WaifuApi();
$response = $waifu->modifyEntry(array(
'token' => 'token',
'password' => ''
'previousPassword' => 'apple'
));
var_dump($response->protected);
use ErnestMarcinko\WaifuVault\WaifuApi;
$waifu = new WaifuApi();
// which is equivalent to:
$waifu = new WaifuApi( new WaifuRequestHandler() );
use ErnestMarcinko\WaifuVault\RequestMethods;
use ErnestMarcinko\WaifuVault\RequestHandler;
class MyCustomWaifuRequestHandler implements RequestHandler {
public function make(
RequestMethods $method,
string $endpoint,
array|null $header = null,
array|string|bool|null $post_fields = null
): static {
// do your thing here
return $this;
}
public function getWaifu(): WaifuResponse {
return new WaifuResponse();
}
public function getTrue(): true {
return true;
}
public function getRaw(): string {
return 'raw file content';
}
}
use ErnestMarcinko\WaifuVault\WaifuApi;
$waifu = new WaifuApi( new MyCustomWaifuRequestHandler() );
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.