Configuration
This chapter describes the parameters that can be used to configure the Feed/XML connector service.
uri
- Type
- string
- Description
- URI of the XML file to read. This may be any of the following syntaxes:
- |
- absolute file path:
/var/
(within the TYPO3 root path orfoo/ web/ fileadmin/ import/ bar. xml TYPO3_
)CONF_ VARS [BE] [lock Root Path] - file path relative to the TYPO3 root:
fileadmin/
import/ foo. xml - file path using
EXT:
:EXT:
foo/ Resources/ Private/ Data/ bar. xml - fully qualified URL, e.g.
http://
www. example. com/ foo. xml - FAL reference with storage ID and file identifier:
FAL:
2:/ foo. xml - custom syntax:
MYKEY:
, see Connector Serviceswhatever_ you_ want
method
- Type
- string
- Description
- Method used to get the file (GET, POST, or whatever else is relevant). This parameter is optional and the method defaults to GET.
headers
- Type
- array
- Description
- Key-value pairs of headers that should be sent along with the request.
- Example
-
Example headers for setting an alternate user agent and defining what reponse format to accept.
'headers' => [ 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:75.0) Gecko/20100101 Firefox/75.0', 'Accept' => 'application/xml', ]
Copied!
encoding
- Type
- string
- Description
-
Encoding of the data found in the file. This value must match any of the encoding values recognized by the PHP libray "mbstring". See https://www.php.net/manual/en/mbstring.supported-encodings.php
Warning
If your are aiming for the array format (i.e. calling
fetch
), you should not define this property. Indeed theArray () \Cobweb\
which is used in this case relies on the SimpleXML library, which already takes care of the encoding conversion. To avoid a double encoding just ignore this property.Svconnector\ Utility\ Connector Utility:: convert Xml To Array ()
useragent
- Type
- string
- Description
-
User agent to fake. This is sometimes necessary to bypass access restrictions on some sites. Don't include the "User-Agent:" part of the header.
Examples:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;rv:1.9.2.13)
Gecko/20101203 Firefox/3.6.13
Warning
This property is deprecated. Pass the user agent as part of the headers instead.