Download the PHP package unit/information without Composer

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

information

Package for calculating and formatting information units like Bit, Byte, Kilobit, Kilobyte, Megabit, Megabyte, etc.

Installation

Units

The used units follow the IEC standard.

Name Abbreviation In Bit In Byte Constant to use
Bit b 1 0.125 Unit\Information\Unit::BIT
Kilobit kb 1000 125 Unit\Information\Unit::KILOBIT
Megabit Mb 1000000 125000 Unit\Information\Unit::MEGABIT
Gigabit Gb 1000000000 125000000 Unit\Information\Unit::GIGABIT
Terabit Tb 1000000000000 125000000000 Unit\Information\Unit::TERABIT
Petabit Pb 1000000000000000 125000000000000 Unit\Information\Unit::PETABIT
Byte B 8 1 Unit\Information\Unit::BYTE
Kilobyte kB 8000 1000 Unit\Information\Unit::KILOBYTE
Megabyte MB 8000000 1000000 Unit\Information\Unit::MEGABYTE
Gigabyte GB 8000000000 1000000000 Unit\Information\Unit::GIGABYTE
Terabyte TB 8000000000000 1000000000000 Unit\Information\Unit::TERABYTE
Petabyte PB 8000000000000000 1000000000000000 Unit\Information\Unit::PETABYTE
Kibibyte KiB 8192 1024 Unit\Information\Unit::KIBIBYTE
Mebibyte MiB 8388608 1048576 Unit\Information\Unit::MEBIBYTE
Gigabyte GiB 8589934592 1073741824 Unit\Information\Unit::GIBIBYTE
Terabyte TiB 8796093022208 1099511627776 Unit\Information\Unit::TEBIBYTE
Pebibyte PiB 9007199254740992 1125899906842624 Unit\Information\Unit::PEBIBYTE

Usage

Intelligent formatting:

Format value in specified unit:

Transform to a number (not a formatted string) value in another unit:

Create a size from a value in a specified unit:

Calculating:

Instantiate from PHP's shorthand values (which do not follow the IEC standard, see https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes):

Development

For some development tools the Symfony binary has to be installed:

Build repo for development:

Testing:

Linting:

License

The MIT License (MIT). Please see License File for more information.


All versions of information with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 unit/information contains the following files

Loading the files please wait ....