PHP code example of twarimitswe-aaron / gatekeeper-cdr
1. Go to this page and download the library: Download twarimitswe-aaron/gatekeeper-cdr 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/ */
twarimitswe-aaron / gatekeeper-cdr example snippets
// Install:
// Add the compiled libgatekeeper.so to your php.ini:
// extension=/path/to/gatekeeper_cdr.so
//
// Or via Composer (planned):
// composer n";
// --- Sanitize (Dual-Output ABI returns both Native and PNG formats) ---
$result = gatekeeper_disarm($raw);
file_put_contents('clean.' . strtolower($result['output_format']), $result['buffer']);
if (!empty($result['png_buffer'])) {
file_put_contents('clean_zerotrust.png', $result['png_buffer']);
}
echo "Sanitized: {$result['original_size_bytes']} bytes -> {$result['final_size_bytes']} bytes\n";