2017 © Pedro Peláez
 

library php-vpk-reader

Library for reading VPK (Valve Pack File).

image

aphexx/php-vpk-reader

Library for reading VPK (Valve Pack File).

  • Thursday, February 18, 2016
  • by Aphexx
  • Repository
  • 2 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHP VPK Reader

VPK archive reader in PHP, (*1)

Reading file contents

$vpk_file = 'package_dir.vpk';
$vpk = new VPKReader\VPK($vpk_file);
$data = $vpk->read_file('/path/to/file.txt', 10000);
echo $data;

Getting directory tree

$vpk_file = 'package_dir.vpk';
$vpk = new VPKReader\VPK($vpk_file);
$ent_tree = $vpk->vpk_entries

$print_tree = function($node, $pwd='') use (&$print_tree){
        if(!is_null($node) && count($node) > 0) {
                if(is_array($node)){
                        echo '

    '; foreach($node as $name=>$subn) { $fp = "$pwd/$name"; echo "
  • $fp"; $print_tree($subn, $fp); echo '
  • '; } echo '
'; }else{ // Node echo " | size: $node->size bytes"; } } }; $print_tree($ent_tree);

The Versions

18/02 2016

dev-master

9999999-dev

Library for reading VPK (Valve Pack File).

  Sources   Download

by Avatar Aphexx