Allow to override the maximum feed size limit

This commit is contained in:
Mathias Kresin 2015-08-04 18:30:41 +02:00
parent cbbf20ebbd
commit 17113779ff
4 changed files with 9 additions and 0 deletions

View File

@ -7,7 +7,9 @@ if (file_exists(__DIR__.'/config.php')) {
} }
defined('APP_VERSION') or define('APP_VERSION', Helper\parse_app_version('$Format:%d$','$Format:%H$')); defined('APP_VERSION') or define('APP_VERSION', Helper\parse_app_version('$Format:%d$','$Format:%H$'));
defined('HTTP_TIMEOUT') or define('HTTP_TIMEOUT', 20); defined('HTTP_TIMEOUT') or define('HTTP_TIMEOUT', 20);
defined('HTTP_MAX_RESPONSE_SIZE') or define('HTTP_MAX_RESPONSE_SIZE', 2097152);
defined('BASE_URL_DIRECTORY') or define('BASE_URL_DIRECTORY', dirname($_SERVER['PHP_SELF'])); defined('BASE_URL_DIRECTORY') or define('BASE_URL_DIRECTORY', dirname($_SERVER['PHP_SELF']));
defined('ROOT_DIRECTORY') or define('ROOT_DIRECTORY', __DIR__); defined('ROOT_DIRECTORY') or define('ROOT_DIRECTORY', __DIR__);

View File

@ -3,6 +3,9 @@
// HTTP_TIMEOUT => default value is 20 seconds (Maximum time to fetch a feed) // HTTP_TIMEOUT => default value is 20 seconds (Maximum time to fetch a feed)
define('HTTP_TIMEOUT', '20'); define('HTTP_TIMEOUT', '20');
// HTTP_MAX_RESPONSE_SIZE => Maximum accepted size of the response body in MB (default 2MB)
defined('HTTP_MAX_RESPONSE_SIZE') or define('HTTP_MAX_RESPONSE_SIZE', 2097152);
// DATA_DIRECTORY => default is data (writable directory) // DATA_DIRECTORY => default is data (writable directory)
define('DATA_DIRECTORY', __DIR__.'/data'); define('DATA_DIRECTORY', __DIR__.'/data');

View File

@ -17,6 +17,9 @@ Actually, the following constants can be overrided:
// HTTP_TIMEOUT => default value is 20 seconds (Maximum time to fetch a feed) // HTTP_TIMEOUT => default value is 20 seconds (Maximum time to fetch a feed)
define('HTTP_TIMEOUT', '20'); define('HTTP_TIMEOUT', '20');
// HTTP_MAX_RESPONSE_SIZE => Maximum accepted size of the response body in MB (default 2MB)
defined('HTTP_MAX_RESPONSE_SIZE') or define('HTTP_MAX_RESPONSE_SIZE', 2097152);
// DATA_DIRECTORY => default is data (writable directory) // DATA_DIRECTORY => default is data (writable directory)
define('DATA_DIRECTORY', __DIR__.'/data'); define('DATA_DIRECTORY', __DIR__.'/data');

View File

@ -21,6 +21,7 @@ function get_reader_config()
// Client // Client
$config->setClientTimeout(HTTP_TIMEOUT); $config->setClientTimeout(HTTP_TIMEOUT);
$config->setClientUserAgent(HTTP_USER_AGENT); $config->setClientUserAgent(HTTP_USER_AGENT);
$config->setMaxBodySize(HTTP_MAX_RESPONSE_SIZE);
// Grabber // Grabber
$config->setGrabberRulesFolder(RULES_DIRECTORY); $config->setGrabberRulesFolder(RULES_DIRECTORY);