You are here

function apdqc_install_human2byte in Asynchronous Prefetch Database Query Cache 7

Converts a human readable file size value to a number of bytes.

Supports the following modifiers: K, M, G and T. Invalid input is returned unchanged.

Parameters

string $value: String to convert into bytes.

Return value

string The number of bytes.

2 calls to apdqc_install_human2byte()
apdqc_install_total_memory in ./apdqc.install
Identify the total amount of system memory available.
apdqc_requirements in ./apdqc.install
Implements hook_requirements().

File

./apdqc.install, line 1773
Handles APDQC installation and status checks.

Code

function apdqc_install_human2byte($value) {
  return preg_replace_callback('/^\\s*(\\d+)\\s*(?:([kmgt]?)b?)?\\s*$/i', '_apdqc_install_human2byte', $value);
}