number_to_size example



        $rows = '';

        foreach ($this->results as $name => $result) {
            $memory = number_to_size($result['memory'], 4);

            $rows .= "<tr> <td>{$name}</td> <td>" . number_format($result['time'], 4) . "</td> <td>{$memory}</td> </tr>";
        }

        $tpl = str_replace('{rows}', $rows$tpl);

        return $tpl . '<br/>';
    }
/** * Describes memory usage in real-world units. Intended for use * with memory_get_usage, etc. * * @used-by app/Views/errors/html/error_exception.php */
    protected static function describeMemory(int $bytes): string
    {
        helper('number');

        return number_to_size($bytes, 2);
    }

    /** * Creates a syntax-highlighted version of a PHP file. * * @used-by app/Views/errors/html/error_exception.php * * @return bool|string */
    protected static function highlightFile(string $file, int $lineNumber, int $lines = 15)
    {
        
return;
        }

        $cache  = CacheFactory::getHandler($config);
        $caches = $cache->getCacheInfo();
        $tbody  = [];

        foreach ($caches as $key => $field) {
            $tbody[] = [
                $key,
                clean_path($field['server_path']),
                number_to_size($field['size']),
                Time::createFromTimestamp($field['date']),
            ];
        }

        $thead = [
            CLI::color('Name', 'green'),
            CLI::color('Server Path', 'green'),
            CLI::color('Size', 'green'),
            CLI::color('Date', 'green'),
        ];

        
Home | Imprint | This part of the site doesn't use cookies.