From 03c495ff92854b3420fcaa560d89acfd1e7b7786 Mon Sep 17 00:00:00 2001 From: gravel Date: Thu, 1 Jun 2023 17:32:04 +0000 Subject: [PATCH] Move option-dependent constants to getopt --- .phpenv | 14 -------------- php/utils/getopt.php | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.phpenv b/.phpenv index a6eb760..2c1e3c5 100644 --- a/.phpenv +++ b/.phpenv @@ -19,20 +19,6 @@ $REPOSITORY_CANONICAL_URL="https://codeberg.org/gravel/sessioncommunities.online"; - // set timeout for file_get_contents() - ini_set('default_socket_timeout', 6); // in seconds, default is 60 - - // curl timeout in milliseconds - - // max time for initiation of the connection - $CURL_CONNECT_TIMEOUT_MS = 2000; - - // max time for each connection (incl. transfer) - $CURL_TIMEOUT_MS = $FAST_FETCH_MODE ? 1500 : 3000; - - // delay between retries in miliseconds - $CURL_RETRY_SLEEP = 2000; - // do not report warnings (timeouts, SSL/TLS errors) error_reporting(E_ALL & ~E_WARNING); diff --git a/php/utils/getopt.php b/php/utils/getopt.php index bb6bd95..cb435ad 100644 --- a/php/utils/getopt.php +++ b/php/utils/getopt.php @@ -14,4 +14,18 @@ if (isset($options["no-color"])) { LoggingVerbosity::$showColor = false; } + + // set timeout for file_get_contents() + ini_set('default_socket_timeout', 6); // in seconds, default is 60 + + // curl timeout in milliseconds + + // max time for initiation of the connection + $CURL_CONNECT_TIMEOUT_MS = 2000; + + // max time for each connection (incl. transfer) + $CURL_TIMEOUT_MS = $FAST_FETCH_MODE ? 1500 : 3000; + + // delay between retries in miliseconds + $CURL_RETRY_SLEEP = 2000; ?> \ No newline at end of file