/**
* Directly set cURL options, for extra flexibility (when in cURL mode).
*
- * It allows eg. to bind client to a specific IP interface / address.
+ * It allows e.g. to bind client to a specific IP interface / address.
*
* @param array $options
* @return $this
if ($username != '') {
$credentials = 'Authorization: Basic ' . base64_encode($username . ':' . $password) . "\r\n";
if ($authType != 1) {
- /// @todo make this a proper error, ie. return a failure
+ /// @todo make this a proper error, i.e. return a failure
$this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported with HTTP 1.0');
}
}
$uri = 'http://' . $server . ':' . $port . $this->path;
if ($proxyUsername != '') {
if ($proxyAuthType != 1) {
- /// @todo make this a proper error, ie. return a failure
+ /// @todo make this a proper error, i.e. return a failure
$this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported with HTTP 1.0');
}
$proxyCredentials = 'Proxy-Authorization: Basic ' . base64_encode($proxyUsername . ':' . $proxyPassword) . "\r\n";
if (defined('CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE')) {
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE);
} else {
- /// @todo make this a proper error, ie. return a failure
+ /// @todo make this a proper error, i.e. return a failure
$this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': warning. HTTP2 is not supported by the current PHP/curl install');
}
break;
if (defined('CURLOPT_HTTPAUTH')) {
curl_setopt($curl, CURLOPT_HTTPAUTH, $authType);
} elseif ($authType != 1) {
- /// @todo make this a proper error, ie. return a failure
+ /// @todo make this a proper error, i.e. return a failure
$this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported by the current PHP/curl install');
}
}
if (defined('CURLOPT_PROXYAUTH')) {
curl_setopt($curl, CURLOPT_PROXYAUTH, $proxyAuthType);
} elseif ($proxyAuthType != 1) {
- /// @todo make this a proper error, ie. return a failure
+ /// @todo make this a proper error, i.e. return a failure
$this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported by the current PHP/curl install');
}
}
$type = gettype($phpVal);
switch ($type) {
case 'string':
- /// @todo should we be stricter in the accepted dates (ie. reject more of invalid days & times)?
+ /// @todo should we be stricter in the accepted dates (i.e. reject more of invalid days & times)?
if (in_array('auto_dates', $options) && preg_match('/^[0-9]{8}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $phpVal)) {
$xmlrpcVal = new Value($phpVal, Value::$xmlrpcDateTime);
} else {
}
}
- // What if internal encoding is not in one of the 3 allowed? We use the broadest one, ie. utf8!
+ // What if internal encoding is not in one of the 3 allowed? We use the broadest one, i.e. utf8!
+ /// @todo with php < 5.6, this does not work. We should add a manual conversion of the xml string to UTF8
if (in_array(PhpXmlRpc::$xmlrpc_internalencoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) {
$parserOptions = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
} else {
* @param array $options integer-key options are passed to the xml parser, in addition to the options received in
* the constructor. String-key options are used independently
* @return void the caller has to look into $this->_xh to find the results
- * @throws \Exception this can happen if a callback function is set and it does throw (ie. we do not catch exceptions)
+ * @throws \Exception this can happen if a callback function is set and it does throw (i.e. we do not catch exceptions)
*/
public function parse($data, $returnType = self::RETURN_XMLRPCVALS, $accept = 3, $options = array())
{
* @param string $name
* @param int $rebuildXmlrpcvals >1 for rebuilding xmlrpcvals, 0 for rebuilding php values, -1 for xmlrpc-extension compatibility
* @return void
- * @throws \Exception this can happen if a callback function is set and it does throw (ie. we do not catch exceptions)
+ * @throws \Exception this can happen if a callback function is set and it does throw (i.e. we do not catch exceptions)
*/
public function xmlrpc_ee($parser, $name, $rebuildXmlrpcvals = 1)
{
$this->_xh['value'] = base64_decode($this->_xh['ac']);
} elseif ($name == 'BOOLEAN') {
// special case here: we translate boolean 1 or 0 into PHP constants true or false.
- // Strings 'true' and 'false' are accepted, even though the spec never mentions them (see eg.
+ // Strings 'true' and 'false' are accepted, even though the spec never mentions them (see e.g.
// Blogger api docs)
- // NB: this simple checks helps a lot sanitizing input, ie. no security problems around here
+ // NB: this simple checks helps a lot sanitizing input, i.e. no security problems around here
if ($this->_xh['ac'] == '1' || strcasecmp($this->_xh['ac'], 'true') == 0) {
$this->_xh['value'] = true;
} else {
}
/**
- * xml parser handler function for 'other stuff', ie. not char data or element start/end tag.
+ * xml parser handler function for 'other stuff', i.e. not char data or element start/end tag.
* In fact it only gets called on unknown entities...
* @internal
*
}
}
// PHP internally might use ISO-8859-1, so we have to tell the xml parser to give us back data in the expected charset.
- // What if internal encoding is not in one of the 3 allowed? We use the broadest one, ie. utf8
+ // What if internal encoding is not in one of the 3 allowed? We use the broadest one, i.e. utf8
if (in_array(PhpXmlRpc::$xmlrpc_internalencoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) {
$options = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
} else {
}
}
// PHP internally might use ISO-8859-1, so we have to tell the xml parser to give us back data in the expected charset.
- // What if internal encoding is not in one of the 3 allowed? We use the broadest one, ie. utf8
+ // What if internal encoding is not in one of the 3 allowed? We use the broadest one, i.e. utf8
if (in_array(PhpXmlRpc::$xmlrpc_internalencoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) {
$options = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
} else {
case static::$xmlrpcDouble:
// avoid using standard conversion of float to string because it is locale-dependent,
// and also because the xmlrpc spec forbids exponential notation.
- // sprintf('%F') could be most likely ok, but it fails eg. on 2e-14.
+ // sprintf('%F') could be most likely ok, but it fails e.g. on 2e-14.
// The code below tries its best at keeping max precision while avoiding exp notation,
// but there is of course no limit in the number of decimal places to be used...
$rs .= "<{$typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</{$typ}>";
* Other libs might choke on the very same xml that will be generated in this case (i.e. it has a nonstandard
* attribute on struct element tags)
*
- * Note that since rel. 2.0RC3 the preferred method to have the server call 'standard' php functions (ie. functions
+ * Note that since rel. 2.0RC3 the preferred method to have the server call 'standard' php functions (i.e. functions
* not expecting a single Request obj as parameter) is by making use of the $functions_parameters_type and
* $exception_handling properties.
*