Many more ore less important changes:
authorRoland Häder <roland@mxchange.org>
Tue, 7 Feb 2012 20:27:34 +0000 (20:27 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 7 Feb 2012 20:27:34 +0000 (20:27 +0000)
- All socket-related exceptions are now extending AbstractSocketException
- New socket-related exceptions added (hub project)
- Minor improvements, comments improved

inc/classes/exceptions/socket/class_InvalidServerSocketException.php
inc/classes/exceptions/socket/class_InvalidSocketException.php
inc/classes/exceptions/socket/class_NoSocketRegisteredException.php
inc/classes/exceptions/socket/class_SocketConnectionException.php
inc/classes/exceptions/socket/class_SocketCreationException.php
inc/classes/exceptions/socket/class_SocketOptionException.php
inc/classes/exceptions/socket/class_SocketShutdownException.php
inc/classes/main/console/class_ConsoleTools.php
inc/config/class_FrameworkConfiguration.php
inc/loader/class_ClassLoader.php

index 98aee08cc530adc869e2a7fa213bc3515814bf36..165b42b3e72016718a9f959ef8c3224142b2bb87 100644 (file)
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class InvalidServerSocketException extends FrameworkException {
+class InvalidServerSocketException extends AbstractSocketException {
        /**
         * A Constructor for this exception
         *
-        * @param               $messageArray   Error message array
-        * @param               $code                   Error code
+        * @param       $messageArray   Error message array
+        * @param       $code                   Error code
         * @return      void
         */
        public function __construct (array $messageData, $code) {
index dc40287ab347e54f32a6b027c64951ae842dee88..e7de2fb36fc190376a305305a7c43b0b932491ba 100644 (file)
@@ -22,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class InvalidSocketException extends FrameworkException {
+class InvalidSocketException extends AbstractSocketException {
        /**
         * A Constructor for this exception
         *
index 4278caf2c444540b6602cb1536ba7c3427301602..7b3ed39b94f4fa1bb3d1a8f1de028c62ea7cf467 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class NoSocketRegisteredException extends FrameworkException {
+class NoSocketRegisteredException extends AbstractSocketException {
        /**
         * A Constructor for this exception
         *
index c7210108c1598400cdcf32ff7c7987eab2815350..c16e8f16c178a1720a9d5f263b3ac28bfb3a6201 100644 (file)
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class SocketConnectionException extends FrameworkException {
+class SocketConnectionException extends AbstractSocketException {
        /**
         * A Constructor for this exception
         *
-        * @param               $messageArray   Error message array
-        * @param               $code                   Error code
+        * @param       $messageArray   Error message array
+        * @param       $code                   Error code
         * @return      void
         */
        public function __construct (array $messageData, $code) {
                // Construct the message
                $message = sprintf("[%s:] Could not make a connection, type=%s, errno=%s, errstr=%s",
                        $messageData[0]->__toString(),
-                       $messageData[1],
+                       gettype($messageData[1]),
                        $messageData[2],
                        $messageData[3]
                );
index d3260a61da095a24b58bcb62814253aeaf133ce2..efc9a0ed1dcdd592ca11261f1181445e3965e175 100644 (file)
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class SocketCreationException extends FrameworkException {
+class SocketCreationException extends AbstractSocketException {
        /**
         * A Constructor for this exception
         *
-        * @param               $messageArray   Error message array
-        * @param               $code                   Error code
+        * @param       $messageArray   Error message array
+        * @param       $code                   Error code
         * @return      void
         */
        public function __construct (array $messageData, $code) {
index a05282773c8797836ec11ce23b59d4bc2a43ec14..63213c91f83a8f69b6c2cef5831baccbd77b1057 100644 (file)
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class SocketOptionException extends FrameworkException {
+class SocketOptionException extends AbstractSocketException {
        /**
         * A Constructor for this exception
         *
-        * @param               $messageArray   Error message array
-        * @param               $code                   Error code
+        * @param       $messageArray   Error message array
+        * @param       $code                   Error code
         * @return      void
         */
        public function __construct (array $messageData, $code) {
                // Construct the message
                $message = sprintf("[%s:] Changing option on socket failed, type=%s, errno=%s, errstr=%s",
                        $messageData[0]->__toString(),
-                       $messageData[1],
+                       gettype($messageData[1]),
                        $messageData[2],
                        $messageData[3]
                );
index 256001b1eab5f292d2b319b22e5548a67ecb330a..9ffd6e5d5ec3d7210807c39689b0f068bf42f843 100644 (file)
@@ -22,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class SocketShutdownException extends FrameworkException {
+class SocketShutdownException extends AbstractSocketException {
        /**
         * A Constructor for this exception
         *
index e43c96946aeb640280d95e675e96fd727c66ce24..ef97485be4fa72e2f131e9d866d108610800b503 100644 (file)
@@ -158,7 +158,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                // Check if there was an error else
                if ($errorNo > 0) {
                        // Then throw again
-                       throw new InvalidSocketException(array($helperInstance, gettype($socketResource), $errorNo, $errorStr), BaseListener::EXCEPTION_INVALID_SOCKET);
+                       throw new InvalidSocketException(array($helperInstance, $socketResource, $errorNo, $errorStr), BaseListener::EXCEPTION_INVALID_SOCKET);
                } // END - if
 
                // Prepare the GET request
index 5006ea46680ef43d5be943444fcf8ad34a7b905f..b3bc491fe1de8092b092a37cd390b57992f7b94f 100644 (file)
@@ -78,7 +78,7 @@ class FrameworkConfiguration implements Registerable {
        /**
         * Setter for default time zone (must be correct!)
         *
-        * @param               $zone   The time-zone string (e.g. Europe/Berlin)
+        * @param       $zone   The time-zone string (e.g. Europe/Berlin)
         * @return      void
         */
        public final function setDefaultTimezone ($zone) {
@@ -90,6 +90,9 @@ class FrameworkConfiguration implements Registerable {
 
        /**
         * Setter for runtime magic quotes
+        *
+        * @param       $enableQuotes   Whether enable magic runtime quotes (should be disabled for security reasons)
+        * @return      void
         */
        public final function setMagicQuotesRuntime ($enableQuotes) {
                // Cast it to boolean
index ae5eb6fe08c8acf4f896ee09eead5550a74f3a06..61d5effc16031fc2b688a26fbb6e7a2d79573e66 100644 (file)
@@ -22,6 +22,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * ----------------------------------
+ * 1.4
+ *  - Some comments improved, other minor improvements
  * 1.3
  *  - Constructor is now empty and factory method 'createClassLoader' is created
  *  - renamed loadClasses to scanClassPath
@@ -139,9 +141,9 @@ class ClassLoader {
        }
 
        /**
-        * Our renamed factory method
+        * Creates an instance of this class loader for given configuration instance
         *
-        * @param       $configInstance Configuration class instance
+        * @param       $configInstance         Configuration class instance
         * @return      void
         */
        public static final function createClassLoader (FrameworkConfiguration $configInstance) {
@@ -219,7 +221,7 @@ class ClassLoader {
        /**
         * Singleton getter for an instance of this class
         *
-        * @return      $selfInstance           A singleton instance of this class
+        * @return      $selfInstance   A singleton instance of this class
         */
        public static final function getSelfInstance () {
                // Is the instance there?
@@ -246,8 +248,11 @@ class ClassLoader {
                        return;
                } // END - if
 
-               // Directories which our class loader ignores by default while
-               // deep-scanning the directory structure.
+               /*
+                * Directories which this class loader ignores by default while
+                * scanning the whole directory structure starting from given base
+                * path.
+                */
                $ignoreList[] = '.';
                $ignoreList[] = '..';
                $ignoreList[] = '.htaccess';
@@ -256,9 +261,11 @@ class ClassLoader {
                // Keep it in class for later usage
                $this->ignoreList = $ignoreList;
 
-               // Set base directory which holds all our classes, we should use an
-               // absolute path here so is_dir(), is_file() and so on will always
-               // find the correct files and dirs.
+               /*
+                * Set base directory which holds all our classes, we should use an
+                * absolute path here so is_dir(), is_file() and so on will always
+                * find the correct files and dirs.
+                */
                $basePath2 = realpath($basePath);
 
                // If the basePath is false it is invalid
@@ -312,7 +319,7 @@ class ClassLoader {
                // Include these extra configs now
                $this->includeExtraConfigs();
 
-               // Set the prefix back
+               // Set back the old prefix
                $this->prefix = $oldPrefix;
        }