Skip to content

Commit

Permalink
Fix namespace issues in Horde\ManageSieve causing PHP Fatal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfbecker committed Jan 27, 2016
1 parent 3861e22 commit d681565
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions framework/ManageSieve/lib/Horde/ManageSieve.php
Expand Up @@ -283,7 +283,7 @@ public function connect(
}

if (self::STATE_DISCONNECTED != $this->_state) {
throw new NotDisconnected();
throw new Exception\NotDisconnected('Not currently in DISCONNECTED state'.' state='.$this->_state);
}

try {
Expand All @@ -295,7 +295,7 @@ public function connect(
$this->_params['context']
);
} catch (Client\Exception $e) {
throw new Exception($e);
throw new Exception\ConnectionFailed($e);
}

if ($this->_params['bypassauth']) {
Expand All @@ -310,7 +310,7 @@ public function connect(
try {
$this->_cmdCapability();
} catch (Exception $e) {
throw new ConnectionFailed($e);
throw new Exception\ConnectionFailed($e);
}

// Check if we can enable TLS via STARTTLS.
Expand Down Expand Up @@ -338,7 +338,7 @@ public function connect(
try {
$this->_cmdCapability();
} catch (Exception $e) {
throw new ConnectionFailed($e);
throw new Exception\ConnectionFailed($e);
}
}
}
Expand Down Expand Up @@ -621,7 +621,7 @@ protected function _cmdAuthenticate(
try {
$this->_cmdCapability();
} catch (Exception $e) {
throw new ConnectionFailed($e);
throw new Exception\ConnectionFailed($e);
}
}

Expand Down Expand Up @@ -968,7 +968,7 @@ protected function _recvBytes($length)
*
* @throws \Horde\ManageSieve\Exception if a NO response.
* @return string Reponse string if an OK response.
*
*
*/
protected function _doCmd($cmd = '', $auth = false)
{
Expand Down Expand Up @@ -1023,7 +1023,7 @@ protected function _doCmd($cmd = '', $auth = false)
try {
$this->_handleConnectAndLogin();
} catch (Exception $e) {
throw new Referral(
throw new Exception\Referral(
'Cannot follow referral to '
. $this->_params['host'] . ', the error was: '
. $e->getMessage()
Expand Down Expand Up @@ -1058,7 +1058,7 @@ protected function _doCmd($cmd = '', $auth = false)
}
}

throw new Referral('Max referral count (' . $referralCount . ') reached.');
throw new Exception\Referral('Max referral count (' . $referralCount . ') reached.');
}

/**
Expand Down Expand Up @@ -1119,7 +1119,7 @@ protected function _getBestAuthMethod($authmethod = null)
protected function _checkConnected()
{
if (self::STATE_DISCONNECTED == $this->_state) {
throw new NotConnected();
throw new Exception\NotConnected();
}
}

Expand All @@ -1131,7 +1131,7 @@ protected function _checkConnected()
protected function _checkAuthenticated()
{
if (self::STATE_AUTHENTICATED != $this->_state) {
throw new NotAuthenticated();
throw new Exception\NotAuthenticated();
}
}

Expand Down
Expand Up @@ -12,7 +12,7 @@
*/

namespace Horde\ManageSieve\Exception;
use Horde\ManageSieve;
use Horde\ManageSieve\Exception;

/**
* Exception thrown if connecting to the server failed.
Expand All @@ -28,9 +28,9 @@ class ConnectionFailed extends Exception
/**
* Exception constructor.
*
* @param Exception $message An Exception object.
* @param Exception $e An Exception object.
*/
public function __construct(Exception $e)
public function __construct(\Exception $e)
{
parent::__construct('Failed to connect, server said: ' . $e->getMessage());
}
Expand Down
Expand Up @@ -12,7 +12,7 @@
*/

namespace Horde\ManageSieve\Exception;
use Horde\ManageSieve;
use Horde\ManageSieve\Exception;

/**
* Exception thrown if the user should be authenticated but isn't.
Expand Down
Expand Up @@ -12,7 +12,7 @@
*/

namespace Horde\ManageSieve\Exception;
use Horde\ManageSieve;
use Horde\ManageSieve\Exception;

/**
* Exception thrown if the server should be connected but isn't.
Expand Down
Expand Up @@ -12,7 +12,7 @@
*/

namespace Horde\ManageSieve\Exception;
use Horde\ManageSieve;
use Horde\ManageSieve\Exception;

/**
* Exception thrown if the server should be disconnected but isn't.
Expand Down
Expand Up @@ -12,7 +12,7 @@
*/

namespace Horde\ManageSieve\Exception;
use Horde\ManageSieve;
use Horde\ManageSieve\Exception;

/**
* Exception thrown if the referring to a different server failed.
Expand Down

0 comments on commit d681565

Please sign in to comment.