gmodstore / php-gmad
package / unpackage garry's mod gma files
1.1.0
2018-04-22 11:37 UTC
Requires
- php-64bit: >=7.1
- mdurrant/php-binary-reader: ~1.0
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-11-10 22:42:13 UTC
README
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.
Requirements
- PHP >=7.1 (64 bit)
- mdurrant/php-binary-reader
Code Examples
$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; }
License
php-gmad is licensed under the MIT License.
Copyright 2018 Matt Stevens