Added SSL support for Socket

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5934 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
the_undefined 2007-11-01 21:37:52 +00:00
parent cf449b14dd
commit 58517b34b0

View file

@ -113,12 +113,17 @@ class CakeSocket extends Object {
if ($this->connection != null) {
$this->disconnect();
}
$scheme = null;
if (isset($this->config['request']) && $this->config['request']['uri']['scheme'] == 'https') {
$scheme = 'ssl://';
}
if ($this->config['persistent'] == true) {
$tmp = null;
$this->connection = @pfsockopen($this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
$this->connection = @pfsockopen($scheme.$this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
} else {
$this->connection = fsockopen($this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
$this->connection = fsockopen($scheme.$this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
}
if (!empty($errNum) || !empty($errStr)) {