nikkiii/vlib
Composer 安装命令:
composer require nikkiii/vlib
包简介
PHP Library for Valve data formats and utilities.
README 文档
README
This is by no means stable, bla bla bla. It works for what I wrote it for, and will be updated as I need more features, or if you need more features, just submit an issue.
Capabilities
- Opening VPK Archives and extracting data
- Opening BSP maps and extracting entities and pakfiles
- Easy usage of Language files/keys via LangWrapper
Installation
Install it using Composer:
composer require nikkiii/vlib
Usage
To open a BSP file:
<?php require_once 'vendor/autoload.php'; use VLib\BSP\BSPFile; $fh = fopen('path/to/map.bsp', 'r'); $bsp = new BSPFile($fh); // $bsp->version = format version // $bsp->entities = entities // $bsp->pakfile = pak file, use openArchive() to get a ZipArchive.
To open a VPK file (Uses Flysystem for universal filesystem access):
<?php require_once 'vendor/autoload.php'; use League\Flysystem\Filesystem; use League\Flysystem\Adapter\Local; use VLib\VPK\VPKArchive; $filesystem = new Filesystem(new Local('/path/to/dir/with/vpks')); $vpk = new VPKArchive($filesystem, 'pak01_dir.vpk'); $entry = $vpk->get('resource/l4d360ui_english.txt'); // To get a stream: $stream = $entry->stream(); // To automatically call stream_get_contents: $contents = $entry->getData();
Using LangWrapper (Ideally you'd load this data from VPKArchive using KeyValues, Warning: You'll probably need to use mb_convert_encoding from UCS-2LE to UTF-8 on language files)
<?php require_once 'vendor/autoload.php'; use VLib\KeyValues\LangWrapper; $tokens = [ 'Something' => 'Blabla' ]; $data = [ 'nested' => [ 'key' => '#Something' ] ]; $lang = new LangWrapper($tokens, $data); echo $lang->get('nested.key'); // Blabla
To open a DEM file:
<?php require_once 'vendor/autoload.php'; use VLib\DEM\DEMFile; $dem = new DEMFile('some_file.dem'); // Either string or resource (open file handle) // $dem->... contains properties
nikkiii/vlib 适用场景与选型建议
nikkiii/vlib 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 09 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「bsp」 「source engine」 「vpk」 「valve formats」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nikkiii/vlib 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nikkiii/vlib 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nikkiii/vlib 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel 5 Package for Using & Working With Emojis
A Laravel 5 Package Provider to Identify/detect a user's browser, device, operating system and Language
A SilverStripe module to optimise the Meta, crawling, indexing, and sharing of your website content (forked from Cyber-Duck/Silverstripe-SEO)
A Processor for Markup written in PHP. Allows extraction of Markup into a data structure, orchestrated nested manipulation of said structure, and output as (optimized) Markup.
Thepeer official Laravel SDK
Shunfeng BSP SDK
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: ISC
- 更新时间: 2015-09-06