From cf051d640b6bd159376cf35e186fa9bb2a9cd7ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 9 Jul 2009 17:33:12 +0000 Subject: [PATCH] Stream classes added to rewrite CrytoHelper --- .gitattributes | 6 +++ inc/classes/main/streams/.htaccess | 1 + inc/classes/main/streams/class_ | 50 ++++++++++++++++++ inc/classes/main/streams/class_BaseStream.php | 42 +++++++++++++++ inc/classes/main/streams/crypto/.htaccess | 1 + .../streams/crypto/class_McryptStream.php | 50 ++++++++++++++++++ .../streams/crypto/class_NullCryptoStream.php | 51 +++++++++++++++++++ 7 files changed, 201 insertions(+) create mode 100644 inc/classes/main/streams/.htaccess create mode 100644 inc/classes/main/streams/class_ create mode 100644 inc/classes/main/streams/class_BaseStream.php create mode 100644 inc/classes/main/streams/crypto/.htaccess create mode 100644 inc/classes/main/streams/crypto/class_McryptStream.php create mode 100644 inc/classes/main/streams/crypto/class_NullCryptoStream.php diff --git a/.gitattributes b/.gitattributes index fcbfa764..c55b41d8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 index 00000000..3a428827 --- /dev/null +++ b/inc/classes/main/streams/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/streams/class_ b/inc/classes/main/streams/class_ new file mode 100644 index 00000000..5da46a42 --- /dev/null +++ b/inc/classes/main/streams/class_ @@ -0,0 +1,50 @@ + + * @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 . + */ +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 index 00000000..e226545a --- /dev/null +++ b/inc/classes/main/streams/class_BaseStream.php @@ -0,0 +1,42 @@ + + * @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 . + */ +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 index 00000000..3a428827 --- /dev/null +++ b/inc/classes/main/streams/crypto/.htaccess @@ -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 index 00000000..2a0127b3 --- /dev/null +++ b/inc/classes/main/streams/crypto/class_McryptStream.php @@ -0,0 +1,50 @@ + + * @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 . + */ +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 index 00000000..1e905bcc --- /dev/null +++ b/inc/classes/main/streams/crypto/class_NullCryptoStream.php @@ -0,0 +1,51 @@ + + * @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 . + */ +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] +?> -- 2.39.5