[TASK] Moved the project to namespaces.

[TASK] Removed all the protocol handlers.
[TASK] Clients are no longer part of the SocketFramework itself.
[TASK] The Framework provides an "interface" to external clients - the ClientDispatcher.
[TASK] Added the Core package and added a better ClassLoader.
[TASK] Created a bootstrap module to include in other projects.
[TASK] Cleaned up comments, reformatted them.
This commit is contained in:
Jan Philipp Timme
2011-12-03 12:43:43 +01:00
parent 8de6bb29b6
commit 16ff75eb1d
32 changed files with 573 additions and 541 deletions
@@ -0,0 +1,41 @@
<?php
namespace JPT\SocketFramework\Exception;
/**
* General exception.
*
* @author jpt
* @package Exception
* @exception
*/
class GeneralException extends \Exception {
/**
* Constructor. Throws a new exception in case the exception is unknown.
*
* @throws UnknownException
* @param string $message
* @param int $code
* @return void
*/
public function __construct($message = "", $code = 0) {
if ($message === "") {
throw new $this('Unknown '. get_class($this));
}
parent::__construct($message, $code);
}
/**
* Puts all the important information into a string.
*
* @return string
*/
public function __toString() {
$string = get_class($this);
$string .= " :" . $this->message;
$string .= " in " . $this->file . "(" . $this->line . ")";
$string .= PHP_EOL . $this->getTraceAsString();
return $string;
}
}
?>