From 0872e66e15241480d982852ad3f396757d1cbb40 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 23 Mar 2024 15:47:59 +0200 Subject: [PATCH] remove global constant declaration --- src/cli/document/crawl.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cli/document/crawl.php b/src/cli/document/crawl.php index 2f1d102..7405fa0 100644 --- a/src/cli/document/crawl.php +++ b/src/cli/document/crawl.php @@ -65,12 +65,6 @@ if (false === sem_acquire($semaphore, true)) exit; } -// Set global options -define( - 'CONFIG_CLI_DOCUMENT_CRAWL_CURL_DOWNLOAD_SIZE_MAX', - $config->cli->document->crawl->curl->download->size->max -); - // Init client try { @@ -203,6 +197,7 @@ foreach($index->search('') $upload, $uploaded ) { + global $config; global $request; global $index; @@ -223,7 +218,7 @@ foreach($index->search('') $document->getId() ); - return $downloaded > CONFIG_CLI_DOCUMENT_CRAWL_CURL_DOWNLOAD_SIZE_MAX ? 1 : 0; + return $downloaded > $config->cli->document->crawl->curl->download->size->max ? 1 : 0; } );