mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 16:26:59 +02:00
Update the PageArrayIterator::$chunkSize setting to be configurable via $config->lazyPageChunkSize per @apeisa
This commit is contained in:
@@ -1129,6 +1129,14 @@ $config->allowExceptions = false;
|
|||||||
*/
|
*/
|
||||||
$config->usePoweredBy = true;
|
$config->usePoweredBy = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chunk size for lazy-loaded pages used by $pages->findMany()
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
$config->lazyPageChunkSize = 250;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Settings specific to InputfieldWrapper class
|
* Settings specific to InputfieldWrapper class
|
||||||
*
|
*
|
||||||
|
@@ -121,6 +121,7 @@
|
|||||||
* @property bool $allowExceptions Allow Exceptions to propagate? (default=false, specify true only if you implement your own exception handler) #pw-group-system
|
* @property bool $allowExceptions Allow Exceptions to propagate? (default=false, specify true only if you implement your own exception handler) #pw-group-system
|
||||||
* @property bool $usePoweredBy Use the x-powered-by header? Set to false to disable. #pw-group-system
|
* @property bool $usePoweredBy Use the x-powered-by header? Set to false to disable. #pw-group-system
|
||||||
* @property bool $useFunctionsAPI Allow most API variables to be accessed as functions? (see /wire/core/FunctionsAPI.php) #pw-group-system
|
* @property bool $useFunctionsAPI Allow most API variables to be accessed as functions? (see /wire/core/FunctionsAPI.php) #pw-group-system
|
||||||
|
* @property int $lazyPageChunkSize Chunk size for for $pages->findMany() calls. #pw-group-system
|
||||||
*
|
*
|
||||||
* @property string $userAuthSalt Salt generated at install time to be used as a secondary/non-database salt for the password system. #pw-group-session
|
* @property string $userAuthSalt Salt generated at install time to be used as a secondary/non-database salt for the password system. #pw-group-session
|
||||||
* @property string $userAuthHashType Default is 'sha1' - used only if Blowfish is not supported by the system. #pw-group-session
|
* @property string $userAuthHashType Default is 'sha1' - used only if Blowfish is not supported by the system. #pw-group-session
|
||||||
|
@@ -73,7 +73,7 @@ class PageArrayIterator extends Wire implements \Iterator {
|
|||||||
* @var int
|
* @var int
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected $chunkSize = 1000;
|
protected $chunkSize = 250;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct
|
* Construct
|
||||||
@@ -92,7 +92,7 @@ class PageArrayIterator extends Wire implements \Iterator {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected function loadChunk() {
|
protected function loadChunk() {
|
||||||
|
$this->chunkSize = (int) $this->wire('config')->lazyPageChunkSize;
|
||||||
$this->pagesPosition = 0;
|
$this->pagesPosition = 0;
|
||||||
$start = $this->currentChunk++ * $this->chunkSize;
|
$start = $this->currentChunk++ * $this->chunkSize;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user