1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-18 04:22:10 +02:00

Move logic for wireBytesStr() function into WireNumberTools class bytesToStr() method, while also making improvements to the method. Also add a strTobytes() method that does the opposite of bytesToStr. This also incorporates the addition of terabytes support submitted in another PR from @matjazpotocnik.

This commit is contained in:
Ryan Cramer
2023-03-10 13:03:30 -05:00
parent 42e56c5f3e
commit 7021347dec
4 changed files with 254 additions and 85 deletions

View File

@@ -164,6 +164,12 @@ class Sanitizer extends Wire {
*
*/
protected $textTools = null;
/**
* @var null|WireNumberTools
*
*/
protected $numberTools = null;
/**
* Runtime caches
@@ -5337,6 +5343,24 @@ class Sanitizer extends Wire {
}
return $this->textTools;
}
/**
* Get instance of WireNumberTools
*
* #pw-group-numbers
* #pw-group-other
*
* @return WireNumberTools
* @since 3.0.214
*
*/
public function getNumberTools() {
if(!$this->numberTools) {
$this->numberTools = new WireNumberTools();
$this->wire($this->numberTools);
}
return $this->numberTools;
}
/**********************************************************************************************************************
* FILE VALIDATORS