You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The short-hand method GeneralUtility::getUrl() provides a fast way to
fetch the contents of a local file or remote URL.
For Remote URLs, TYPO3 v8 provides an object-oriented (PSR-7 compatible)
way by using the RequestFactory->request($url, $method, $options) API.
Under the hood, the PHP library GuzzleHTTP is used, which evaluates what
best option (e.g. curl library) should handle the download to TYPO3.
In general, it is recommended for any third-party extension developer to
use either PHP's native file_get_contents($file) method or the RequestFactory->request() method to fetch a PSR-7 ResponseInterface
object.
The additional arguments in GeneralUtility::getUrl() which allowed to
send headers to the content or just do a HEAD request, or find reports
on why the request did not succeed have been marked as deprecated.
PHP's native Exception Handling and the response object give enough
insights already to load the HTTP headers as well, or even do HTTP POST requests.
Impact
Calling the method GeneralUtility::getUrl() with more than one method
argument will trigger a PHP E_USER_DEPRECATED error.
Affected Installations
TYPO3 installations using a third-party extension with GeneralUtility::getUrl() and more than one parameter in the call.
Migration
Depending on the use-case of using the additional method parameters,
certain alternatives exist since TYPO3 v8 already:
Fetching the headers (as array) from a HTTP response:
$response = GeneralUtility::makeInstance(RequestFactory::class)->request($url);
$allHeaders = $response->getHeaders();
// Also see $response->getHeader($headerName) and $response->getHeaderLine($headerName)
Deprecation: #90956 - Alternative fetch methods and reports for GeneralUtility::getUrl()
https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/10.4/Deprecation-90956-AlternativeFetchMethodsAndReportsForGeneralUtilitygetUrl.html
Deprecation: #90956 - Alternative fetch methods and reports for GeneralUtility::getUrl()
See 90956
Description
The short-hand method
GeneralUtility::getUrl()
provides a fast way tofetch the contents of a local file or remote URL.
For Remote URLs, TYPO3 v8 provides an object-oriented (PSR-7 compatible)
way by using the
RequestFactory->request($url, $method, $options)
API.Under the hood, the PHP library GuzzleHTTP is used, which evaluates what
best option (e.g. curl library) should handle the download to TYPO3.
In general, it is recommended for any third-party extension developer to
use either PHP's native
file_get_contents($file)
method or theRequestFactory->request()
method to fetch a PSR-7 ResponseInterfaceobject.
The additional arguments in
GeneralUtility::getUrl()
which allowed tosend headers to the content or just do a HEAD request, or find reports
on why the request did not succeed have been marked as deprecated.
PHP's native Exception Handling and the response object give enough
insights already to load the HTTP headers as well, or even do HTTP
POST requests.
Impact
Calling the method
GeneralUtility::getUrl()
with more than one methodargument will trigger a PHP
E_USER_DEPRECATED
error.Affected Installations
TYPO3 installations using a third-party extension with
GeneralUtility::getUrl()
and more than one parameter in the call.Migration
Depending on the use-case of using the additional method parameters,
certain alternatives exist since TYPO3 v8 already:
Fetching the headers (as array) from a HTTP response:
Sending additional headers with the HTTP request:
Finding additional information about the response:
PHP-API, FullyScanned, ext:core
The text was updated successfully, but these errors were encountered: