Stream classes added to rewrite CrytoHelper
authorRoland Häder <roland@mxchange.org>
Thu, 9 Jul 2009 17:33:12 +0000 (17:33 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 9 Jul 2009 17:33:12 +0000 (17:33 +0000)
.gitattributes
inc/classes/main/streams/.htaccess [new file with mode: 0644]
inc/classes/main/streams/class_ [new file with mode: 0644]
inc/classes/main/streams/class_BaseStream.php [new file with mode: 0644]
inc/classes/main/streams/crypto/.htaccess [new file with mode: 0644]
inc/classes/main/streams/crypto/class_McryptStream.php [new file with mode: 0644]
inc/classes/main/streams/crypto/class_NullCryptoStream.php [new file with mode: 0644]

index fcbfa76..c55b41d 100644 (file)
@@ -439,6 +439,12 @@ inc/classes/main/result/.htaccess -text
 inc/classes/main/result/class_DatabaseResult.php -text
 inc/classes/main/rng/.htaccess -text
 inc/classes/main/rng/class_RandomNumberGenerator.php -text
+inc/classes/main/streams/.htaccess -text
+inc/classes/main/streams/class_ -text
+inc/classes/main/streams/class_BaseStream.php -text
+inc/classes/main/streams/crypto/.htaccess -text
+inc/classes/main/streams/crypto/class_McryptStream.php -text
+inc/classes/main/streams/crypto/class_NullCryptoStream.php -text
 inc/classes/main/template/.htaccess -text
 inc/classes/main/template/class_ -text
 inc/classes/main/template/class_BaseTemplateEngine.php -text
diff --git a/inc/classes/main/streams/.htaccess b/inc/classes/main/streams/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/streams/class_ b/inc/classes/main/streams/class_
new file mode 100644 (file)
index 0000000..5da46a4
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009  Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 ???Stream extends BaseStream implements Streamable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this node class
+        *
+        * @return      $streamInstance         An instance of this node class
+        */
+       public final static function create???Stream (Requestable $requestInstance) {
+               // Get a new instance
+               $streamInstance = new ???Stream();
+
+               // Return the instance
+               return $streamInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/streams/class_BaseStream.php b/inc/classes/main/streams/class_BaseStream.php
new file mode 100644 (file)
index 0000000..e226545
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * A general stream class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 BaseStream extends BaseFrameworkSystem {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/streams/crypto/.htaccess b/inc/classes/main/streams/crypto/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/streams/crypto/class_McryptStream.php b/inc/classes/main/streams/crypto/class_McryptStream.php
new file mode 100644 (file)
index 0000000..2a0127b
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A mcrypt-based encryption stream
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 McryptStream extends BaseStream {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this node class
+        *
+        * @return      $streamInstance         An instance of this node class
+        */
+       public final static function createMcryptStream () {
+               // Get a new instance
+               $streamInstance = new McryptStream();
+
+               // Return the instance
+               return $streamInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/streams/crypto/class_NullCryptoStream.php b/inc/classes/main/streams/crypto/class_NullCryptoStream.php
new file mode 100644 (file)
index 0000000..1e905bc
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/**
+ * A null-encryption stream does not encrypt anything but can be used if e.e.
+ * mcrypt is not installed.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009  Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 NullCryptoStream extends BaseStream implements Streamable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this node class
+        *
+        * @return      $streamInstance         An instance of this node class
+        */
+       public final static function createNullCryptoStream () {
+               // Get a new instance
+               $streamInstance = new NullCryptoStream();
+
+               // Return the instance
+               return $streamInstance;
+       }
+}
+
+// [EOF]
+?>