diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/array_helper.php | 2 | ||||
-rw-r--r-- | system/helpers/date_helper.php | 8 | ||||
-rw-r--r-- | system/libraries/Xmlrpc.php | 23 |
3 files changed, 24 insertions, 9 deletions
diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php index 216f12e56..5d0243951 100644 --- a/system/helpers/array_helper.php +++ b/system/helpers/array_helper.php @@ -43,7 +43,7 @@ if ( ! function_exists('element')) * Element * * Lets you determine whether an array index is set and whether it has a value. - * If the element is empty it returns FALSE (or whatever you specify as the default value.) + * If the element is empty it returns NULL (or whatever you specify as the default value.) * * @param string * @param array diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index fc790c585..9637e26ce 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -124,16 +124,16 @@ if ( ! function_exists('standard_date')) function standard_date($fmt = 'DATE_RFC822', $time = '') { $formats = array( - 'DATE_ATOM' => '%Y-%m-%dT%H:%i:%s%O', + 'DATE_ATOM' => '%Y-%m-%dT%H:%i:%s%P', 'DATE_COOKIE' => '%l, %d-%M-%y %H:%i:%s UTC', - 'DATE_ISO8601' => '%Y-%m-%dT%H:%i:%s%O', + 'DATE_ISO8601' => '%Y-%m-%dT%H:%i:%s%P', 'DATE_RFC822' => '%D, %d %M %y %H:%i:%s %O', 'DATE_RFC850' => '%l, %d-%M-%y %H:%i:%s UTC', 'DATE_RFC1036' => '%D, %d %M %y %H:%i:%s %O', 'DATE_RFC1123' => '%D, %d %M %Y %H:%i:%s %O', - 'DATE_RFC2822' => '%D, %d %M %Y %H:%i:%s %O', + 'DATE_RFC2822' => '%r', 'DATE_RSS' => '%D, %d %M %Y %H:%i:%s %O', - 'DATE_W3C' => '%Y-%m-%dT%H:%i:%s%O' + 'DATE_W3C' => '%Y-%m-%dT%H:%i:%s%P' ); return isset($formats[$fmt]) ? mdate($formats[$fmt], $time) : FALSE; diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index eac4ac118..cbb91c40a 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -174,7 +174,7 @@ class CI_Xmlrpc { * @param int port * @return void */ - public function server($url, $port = 80) + public function server($url, $port = 80, $proxy = FALSE, $proxy_port = 8080) { if (strpos($url, 'http') !== 0) { @@ -190,7 +190,7 @@ class CI_Xmlrpc { $path .= '?'.$parts['query']; } - $this->client = new XML_RPC_Client($path, $parts['host'], $port); + $this->client = new XML_RPC_Client($path, $parts['host'], $port, $proxy, $proxy_port); } // -------------------------------------------------------------------- @@ -385,6 +385,8 @@ class XML_RPC_Client extends CI_Xmlrpc public $path = ''; public $server = ''; public $port = 80; + public $proxy = FALSE; + public $proxy_port = 8080; public $errno = ''; public $errstring = ''; public $timeout = 5; @@ -398,13 +400,15 @@ class XML_RPC_Client extends CI_Xmlrpc * @param int * @return void */ - public function __construct($path, $server, $port = 80) + public function __construct($path, $server, $port = 80, $proxy = FALSE, $proxy_port = 8080) { parent::__construct(); $this->port = $port; $this->server = $server; $this->path = $path; + $this->proxy = $proxy; + $this->proxy_port = $proxy_port; } // -------------------------------------------------------------------- @@ -436,7 +440,18 @@ class XML_RPC_Client extends CI_Xmlrpc */ public function sendPayload($msg) { - $fp = @fsockopen($this->server, $this->port,$this->errno, $this->errstring, $this->timeout); + if ($this->proxy === FALSE) + { + $server = $this->server; + $port = $this->port; + } + else + { + $server = $this->proxy; + $port = $this->proxy_port; + } + + $fp = @fsockopen($server, $port, $this->errno, $this->errstring, $this->timeout); if ( ! is_resource($fp)) { |