-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from Evaneos/add_lazy_ssl_connection
Add a way to create lazy SSL connections
- Loading branch information
Showing
2 changed files
with
82 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace Burrow\Connection\PhpAmqpLib; | ||
|
||
use PhpAmqpLib\Connection\AMQPSSLConnection; | ||
|
||
class AMQPLazySSLConnection extends AMQPSSLConnection | ||
{ | ||
/** | ||
* Gets socket from current connection | ||
* | ||
* @deprecated | ||
*/ | ||
public function getSocket() | ||
{ | ||
$this->connect(); | ||
|
||
return parent::getSocket(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function channel($channel_id = null) | ||
{ | ||
$this->connect(); | ||
|
||
return parent::channel($channel_id); | ||
} | ||
|
||
/** | ||
* @return null|\PhpAmqpLib\Wire\IO\AbstractIO | ||
*/ | ||
public function getIO() | ||
{ | ||
if (empty($this->io)) { | ||
$this->connect(); | ||
} | ||
|
||
return $this->io; | ||
} | ||
|
||
/** | ||
* Should the connection be attempted during construction? | ||
* | ||
* @return bool | ||
*/ | ||
public function connectOnConstruct() | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters