Download the PHP package mdurrant/php-binary-reader without Composer

On this page you can find all versions of the php package mdurrant/php-binary-reader. 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 php-binary-reader

PhpBinaryReader

Build Status Code Coverage Scrutinizer Code Quality

Why?

You probably wouldn't be here if you hadn't run into a scenario where you needed to leverage PHP to read a stream of binary data. The honest truth is PHP really stinks at this stuff, but as long as we're going to be using it we may as well do our best to make it as painless as possible.

The purpose of this binary reader is to accept a string of file contents or file resource and provide a set of methods inspired by .NET to traverse it.

Note on Endians

The reader is designed to work on little endian machines, which is going to apply to most scenarios as all x86 and x86-64 machines are little endian. If you have somehow found yourself on a big endian machine, you need to inform the class or you may not be able to properly read signed integers in the file you're parsing.

Example Usage

Methods

__construct($input, $endian) a string or file resource must be provided to use this class, an endian is optional (string [big|little], or use the constants in the Endian class), it will default to little if not provided.

readUInt8() returns a single 8 bit byte as an unsigned integer

readInt8() returns a single 8 bit byte as a signed integer

readUInt16() returns a 16-bit short as an unsigned integer

readInt16() returns a 16-bit short as a signed integer

readUInt32() returns a 32-bit unsigned integer

readInt32() returns a 32-bit signed integer

readUInt64() returns a 64-bit unsigned integer

readInt64() returns a 64-bit signed integer

readSingle() returns a 4-bytes floating-point

readUBits($length) returns a variable length of bits (unsigned)

readBits($length) returns a variable length of bits (signed)

readBytes($length) returns a variable length of bytes

readString($length) returns a variable length string

readAlignedString($length) aligns the pointer to 0 bits and returns a variable length string

align() aligns the pointer back to 0 bits

isEof() returns true if the pointer is on the last byte of the file

getPosition() returns the current byte position in the file

setPosition($position) sets the current byte position

getCurrentBit() returns the current bit position in the file

setCurrentBit($currentBit) sets the current bit position

Contributing

Contributions must follow the PSR2 coding standards and must not degrade 100% coverage.

Acknowledgements

Significant portions of the work is based on Graylin Kim's Python bit/byte reader in sc2reader_

.. _sc2reader: https://github.com/GraylinKim/sc2reader


All versions of php-binary-reader with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
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 mdurrant/php-binary-reader contains the following files

Loading the files please wait ....