Download the PHP package brandon/nbt without Composer

On this page you can find all versions of the php package brandon/nbt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nbt

NBT to PHP

NBT to PHP allows you to convert NBT data to PHP data types to easily use within a PHP program.

Introduction

Since this program converts the NBT data to native PHP data types, there is currently no way to convert the data back to NBT data since PHP has fewer data types than NBT.

An advantage is having no PHP to NBT converter is this library is very lightweight and works very well in applications where read-only functionality is needed, like reading from an API or file.

An advantage of the approach of converting to PHP data types is that it is very easy to display and read the output using print_r.

Installation

Composer

This library can be downloaded using Composer. For example you can add the following to your composer.json file.

It is recommended to replace * with a version constraint.

Git

There are several ways to download directly from GitHub, the only required file is NBT.php.

After downloading, to use the library you would use:

Documentation

As of now, all functions in this library as static, meaning there's no need to create a new object of type NBT, but you can.

There are 3 main functions that you should access, NBT::readFile, NBT::readString, and NBT::readStream.

NBT::readFile

NBT::readFile is used to read NBT data from a file.

Parameters

Returns

An array with the NBT data converted to PHP.

NBT::readString

NBT::readString is used to read NBT data from a string.

Parameters

Returns

An array with the NBT data converted to PHP.

NBT::readStream

NBT::readStream is used to read NBT data from a file stream.

Parameters

Returns

An array with the NBT data converted to PHP.

NBT::readTag

NBT::readTag is used to read a NBT tag from a file stream.

Parameters

Returns

The NBT data read as PHP data, return type depends on the $type parameter.

Testing

Tests for this script can be found in the tests/test.php php file. You may run php tests/test.php to test this script.


All versions of nbt with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package brandon/nbt contains the following files

Loading the files please wait ....