__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
namespace OpenSpout\Reader\XLSX\Manager\SharedStringsCaching;
/**
* @internal
*/
final class MemoryLimit
{
private readonly string $memoryLimit;
public function __construct(string $memoryLimit)
{
$this->memoryLimit = $memoryLimit;
}
/**
* Returns the PHP "memory_limit" in Kilobytes.
*/
public function getMemoryLimitInKB(): float
{
$memoryLimitFormatted = strtolower(trim($this->memoryLimit));
// No memory limit
if ('-1' === $memoryLimitFormatted) {
return -1;
}
if (1 === preg_match('/(\d+)([bkmgt])b?/', $memoryLimitFormatted, $matches)) {
$amount = (int) $matches[1];
$unit = $matches[2];
switch ($unit) {
case 'b': return $amount / 1024;
case 'k': return $amount;
case 'm': return $amount * 1024;
case 'g': return $amount * 1024 * 1024;
case 't': return $amount * 1024 * 1024 * 1024;
}
}
return -1;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| CachingStrategyFactory.php | File | 4.43 KB | 0777 |
|
| CachingStrategyFactoryInterface.php | File | 720 B | 0777 |
|
| CachingStrategyInterface.php | File | 1.27 KB | 0777 |
|
| FileBasedStrategy.php | File | 6.56 KB | 0777 |
|
| InMemoryStrategy.php | File | 2.5 KB | 0777 |
|
| MemoryLimit.php | File | 1.08 KB | 0777 |
|