[TYPO3-dev] how to include t3lib_http_Request and PEAR packages from contrib/pear folder

Michael typo3ml at schams.net
Fri Jan 27 03:36:50 CET 2012


Hi!

Since TYPO3 v4.6.x this new HTTP Request Utility class has been
implemented in the core... very nice :-)

Unfortunately, I struggle to include it in my FE extensions.
t3lib_http_Request extends HTTP_Request2, which exists in
typo3/contrib/pear/HTTP/Request2.php.

Something like...

$request = t3lib_div::makeInstance('t3lib_http_Request', $url, $method,
$config);

...loads the PEAR file "Request2.php", which tries to include
"Net/URL2.php" and fails, because it can not find the file:

PHP Fatal error: require_once(): Failed opening required 'Net/URL2.php'
(include_path='.:/usr/share/php:/usr/share/pear') in
/var/www/introductionpackage-4.6.3/typo3_src-4.6.3/typo3/contrib/pear/HTTP/Request2.php
on line 47

What is the recommended way to include "t3lib_http_Request" or PEAR
packages in general from the contrib/pear/ directory in a FE extension?

I came across this Wiki page as well and I had a look at
sysext:linkchecker, which uses t3lib_http_Request, but this could not
solve my issue (maybe FE/BE differences?).

http://wiki.typo3.org/wiki/T3lib_http_Request

Thanks for any guidance or examples (e.g. FE extension that uses
t3lib_http_Request).

Cheers
Michael




More information about the TYPO3-dev mailing list