]> git.mxchange.org Git - core.git/commitdiff
Renamed 'seperator' to 'separator'
authorRoland Häder <roland@mxchange.org>
Sat, 11 Feb 2012 16:02:26 +0000 (16:02 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 11 Feb 2012 16:02:26 +0000 (16:02 +0000)
inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/helper/web/links/class_WebLinkHelper.php
inc/classes/main/io/class_FileIoStream.php
inc/classes/main/streams/crypto/class_McryptStream.php
inc/classes/third_party/api/primusportal/class_PrimeraApi.php

index e983a69893f4e8748cf009dadcb519d5fc1f336d..f551ef47b7591c74e7b59193e56a1fa6505a87ab 100644 (file)
@@ -1,45 +1,3 @@
 <?php
-/**
- * An exception thrown when the decimal and thousands seperators are missing
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 MissingDecimalsThousandsSeperatorException extends FrameworkException {
-       /**
-        * The constructor
-        *
-        * @param       $message        Message from the exception
-        * @param       $code           Code number for the exception
-        * @return      void
-        */
-       public function __construct ($instance, $code) {
-               // Add a message around the missing class
-               $message = sprintf("[%s:%d] Die Dezimal- und Tausendertrenner fehlen!",
-                       $instance->__toString(),
-                       $this->getLine()
-               );
-
-               // Call parent constructor
-               parent::__construct($message, $code);
-       }
-}
-
-// [EOF]
+// @DEPRECATED
 ?>
index 10ce072b8d43c420bd3e71fab6dd23b94f559715..d142efb106a7f0f90c2dd6bad8c6c091a388fff8 100644 (file)
@@ -169,12 +169,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        private $wrapperInstance = NULL;
 
        /**
-        * Thousands seperator
+        * Thousands separator
         */
        private $thousands = '.'; // German
 
        /**
-        * Decimal seperator
+        * Decimal separator
         */
        private $decimals  = ','; // German
 
@@ -757,21 +757,21 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
        /**
         * Formats computer generated price values into human-understandable formats
-        * with thousand and decimal seperators.
+        * with thousand and decimal separators.
         *
         * @param       $value          The in computer format value for a price
         * @param       $currency       The currency symbol (use HTML-valid characters!)
         * @param       $decNum         Number of decimals after commata
         * @return      $price          The for the current language formated price string
-        * @throws      MissingDecimalsThousandsSeperatorException      If decimals or
-        *                                                                                              thousands seperator
+        * @throws      MissingDecimalsThousandsSeparatorException      If decimals or
+        *                                                                                              thousands separator
         *                                                                                              is missing
         */
        public function formatCurrency ($value, $currency = '&euro;', $decNum = 2) {
                // Are all required attriutes set?
                if ((!isset($this->decimals)) || (!isset($this->thousands))) {
                        // Throw an exception
-                       throw new MissingDecimalsThousandsSeperatorException($this, self::EXCEPTION_ATTRIBUTES_ARE_MISSING);
+                       throw new MissingDecimalsThousandsSeparatorException($this, self::EXCEPTION_ATTRIBUTES_ARE_MISSING);
                } // END - if
 
                // Cast the number
index 4ea1819b1b40d7a425690948a2566fca79a9d2ff..dcb01d6468d4b9b336575fc870fe9d68f2843f7b 100644 (file)
@@ -33,14 +33,14 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
        private $linkBase = '';
 
        /**
-        * First parameter seperator
+        * First parameter separator
         */
-       const FIRST_PARAMETER_SEPERATOR = '?';
+       const FIRST_PARAMETER_SEPARATOR = '?';
 
        /**
-        * Seperator for more paraemters
+        * SEPARATOR for more paraemters
         */
-       const EXTRA_PARAMETER_SEPERATOR = '&amp;';
+       const EXTRA_PARAMETER_SEPARATOR = '&amp;';
 
        /**
         * Protected constructor
@@ -276,19 +276,19 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
                        throw new NoGroupOpenedException(array($this, $linkAction . '(' . $linkText . ')'), self::EXCEPTION_GROUP_NOT_OPENED);
                } // END - if
 
-               // Default parameter seperator is &amp;
-               $seperator = self::EXTRA_PARAMETER_SEPERATOR;
+               // Default parameter SEPARATOR is &amp;
+               $separator = self::EXTRA_PARAMETER_SEPARATOR;
 
                // Is there a question mark in?
-               $linkArray = explode(self::FIRST_PARAMETER_SEPERATOR, $this->getLinkBase());
+               $linkArray = explode(self::FIRST_PARAMETER_SEPARATOR, $this->getLinkBase());
                if (count($linkArray) == 0) {
                        // No question mark
-                       $seperator = self::FIRST_PARAMETER_SEPERATOR;
+                       $separator = self::FIRST_PARAMETER_SEPARATOR;
                } // END - if
 
                // Prepare action
                $action = sprintf("%saction=%s",
-                       $seperator,
+                       $separator,
                        $linkAction
                );
 
index 98af0428497b72caa043638f1b383d200d14ff0b..e1ccd8aa6333984e30e42995bcbfa3bbb87aeecd 100644 (file)
@@ -33,14 +33,14 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
        const FILE_IO_DATA_BLOCK_ID = '@data';
 
        /**
-        * Seperator #1
+        * Separator #1
         */
        const FILE_IO_CHUNKER = ':';
 
        /**
-        * Seperator #2
+        * Separator #2
         */
-       const FILE_IO_SEPERATOR = '^';
+       const FILE_IO_SEPARATOR = '^';
 
        /**
         * Protected constructor
@@ -95,7 +95,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                // Write a header information for validation purposes
                $fileInstance->writeToFile(sprintf("%s%s%s%s%s%s%s%s%s\n",
                        self::FILE_IO_FILE_HEADER_ID,
-                       self::FILE_IO_SEPERATOR,
+                       self::FILE_IO_SEPARATOR,
                        $dataArray[0],
                        self::FILE_IO_CHUNKER,
                        time(),
@@ -117,7 +117,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                        // Save it to the stream
                        $fileInstance->writeToFile(sprintf("%s%s%s%s%s\n",
                                self::FILE_IO_DATA_BLOCK_ID,
-                               self::FILE_IO_SEPERATOR,
+                               self::FILE_IO_SEPARATOR,
                                $line,
                                self::FILE_IO_CHUNKER,
                                md5($line)
@@ -175,7 +175,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                        // Analyze this line
                        if (substr($rawLine, 0, 5) == self::FILE_IO_FILE_HEADER_ID) {
                                // Header found, so let's extract it
-                               $header = explode(self::FILE_IO_SEPERATOR, $rawLine);
+                               $header = explode(self::FILE_IO_SEPARATOR, $rawLine);
                                $header = trim($header[1]);
 
                                // Now we must convert it again into an array
@@ -188,7 +188,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                                } // END - if
                        } elseif (substr($rawLine, 0, 5) == self::FILE_IO_DATA_BLOCK_ID) {
                                // Is a data line!
-                               $data = explode(self::FILE_IO_SEPERATOR, $rawLine);
+                               $data = explode(self::FILE_IO_SEPARATOR, $rawLine);
                                $data = $data[1];
 
                                // First element is the data, second the MD5 checksum
index 5bab4ef5fc428e63a48143013dea21269299c193..bb6a89d783c0613f5ad820f4ca775a883a11199b 100644 (file)
@@ -23,9 +23,9 @@
  */
 class McryptStream extends BaseStream implements EncryptableStream {
        /**
-        * Seperator on many places
+        * Separator on many places
         */
-       const DATA_PAYLOAD_SEPERATOR = '|';
+       const DATA_PAYLOAD_SEPARATOR = '|';
 
        /**
         * Protected constructor
@@ -75,39 +75,39 @@ class McryptStream extends BaseStream implements EncryptableStream {
                // Add some "payload" to the string
                switch ($this->getRngInstance()->randomNumber(0, 8)) {
                        case 0:
-                               $payloadString = crc32($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPERATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPERATOR . crc32($this->getRngInstance()->randomString(20));
+                               $payloadString = crc32($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPARATOR . crc32($this->getRngInstance()->randomString(20));
                                break;
 
                        case 1:
-                               $payloadString = crc32($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPERATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPERATOR . md5($this->getRngInstance()->randomString(20));
+                               $payloadString = crc32($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPARATOR . md5($this->getRngInstance()->randomString(20));
                                break;
 
                        case 2:
-                               $payloadString = crc32($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPERATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPERATOR . sha1($this->getRngInstance()->randomString(20));
+                               $payloadString = crc32($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPARATOR . sha1($this->getRngInstance()->randomString(20));
                                break;
 
                        case 3:
-                               $payloadString = md5($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPERATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPERATOR . crc32($this->getRngInstance()->randomString(20));
+                               $payloadString = md5($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPARATOR . crc32($this->getRngInstance()->randomString(20));
                                break;
 
                        case 4:
-                               $payloadString = md5($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPERATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPERATOR . md5($this->getRngInstance()->randomString(20));
+                               $payloadString = md5($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPARATOR . md5($this->getRngInstance()->randomString(20));
                                break;
 
                        case 5:
-                               $payloadString = md5($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPERATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPERATOR . sha1($this->getRngInstance()->randomString(20));
+                               $payloadString = md5($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPARATOR . sha1($this->getRngInstance()->randomString(20));
                                break;
 
                        case 6:
-                               $payloadString = sha1($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPERATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPERATOR . crc32($this->getRngInstance()->randomString(20));
+                               $payloadString = sha1($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPARATOR . crc32($this->getRngInstance()->randomString(20));
                                break;
 
                        case 7:
-                               $payloadString = sha1($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPERATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPERATOR . md5($this->getRngInstance()->randomString(20));
+                               $payloadString = sha1($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPARATOR . md5($this->getRngInstance()->randomString(20));
                                break;
 
                        case 8:
-                               $payloadString = sha1($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPERATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPERATOR . sha1($this->getRngInstance()->randomString(20));
+                               $payloadString = sha1($this->getRngInstance()->randomString(10)) . self::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . self::DATA_PAYLOAD_SEPARATOR . sha1($this->getRngInstance()->randomString(20));
                                break;
                }
 
@@ -140,7 +140,7 @@ class McryptStream extends BaseStream implements EncryptableStream {
                $payloadString = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_ECB, $iv);
 
                // Get the real string out
-               $strArray = explode(self::DATA_PAYLOAD_SEPERATOR, $payloadString);
+               $strArray = explode(self::DATA_PAYLOAD_SEPARATOR, $payloadString);
 
                // Does the element count match?
                assert(count($strArray) == 3);
index 2251e4a53c20d7ddfd71f4fe85629b353b424eb8..a265c479f6468a032b1cf95ae6d6da80d58b42d5 100644 (file)
@@ -129,7 +129,7 @@ class PrimeraApi extends BaseFrameworkSystem {
        private $errno = 0;
        private $err = '';
 
-       private $seperator = ':';
+       private $separator = ':';
 
        private $username = '';
        private $password = '';
@@ -187,7 +187,7 @@ class PrimeraApi extends BaseFrameworkSystem {
                $x = explode("\n", $content);
                $return = array();
                foreach($x as $currentLine) {
-                       $line_exploded = explode($this->seperator, $currentLine,2);
+                       $line_exploded = explode($this->separator, $currentLine,2);
                        if (count($line_exploded) > 1) {
                                $return[$line_exploded[0]] = $line_exploded[1];
                        } // END - if