PHP Garry's Mod Addon Library (php-gmad) is a PHP library for handling and manipulation of Garry's Mod addon files (.gmad). These files provide a description of the addon and a filesystem of the addon, both can be managed using this library.
- PHP >=7.1 (64 bit)
- mdurrant/php-binary-reader
$gma_data = fopen(__DIR__ . '/gmas/test.gma', 'rb');
$reader = new AddonReader($gma_data);
$reader->parse(); // throws
$addon = $reader->getAddon();
echo $addon . PHP_EOL;
echo count($addon->getFileIndex()) . ' file(s): ' . PHP_EOL;
foreach ($addon->getFileIndex() as $file) {
echo "\t" . $file->getFileNumber() . '. ' . $file->getPath() . ' @ ' . $file->getOffset() . ' : ' . $file->getSize() . ' bytes' . PHP_EOL;
}
php-gmad is licensed under the MIT License.
Copyright 2018 Matt Stevens