<?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
?>
private $wrapperInstance = NULL;
/**
- * Thousands seperator
+ * Thousands separator
*/
private $thousands = '.'; // German
/**
- * Decimal seperator
+ * Decimal separator
*/
private $decimals = ','; // German
/**
* 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 = '€', $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
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 = '&';
+ const EXTRA_PARAMETER_SEPARATOR = '&';
/**
* Protected constructor
throw new NoGroupOpenedException(array($this, $linkAction . '(' . $linkText . ')'), self::EXCEPTION_GROUP_NOT_OPENED);
} // END - if
- // Default parameter seperator is &
- $seperator = self::EXTRA_PARAMETER_SEPERATOR;
+ // Default parameter SEPARATOR is &
+ $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
);
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
// 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(),
// 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)
// 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
} // 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
*/
class McryptStream extends BaseStream implements EncryptableStream {
/**
- * Seperator on many places
+ * Separator on many places
*/
- const DATA_PAYLOAD_SEPERATOR = '|';
+ const DATA_PAYLOAD_SEPARATOR = '|';
/**
* Protected constructor
// 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;
}
$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);
private $errno = 0;
private $err = '';
- private $seperator = ':';
+ private $separator = ':';
private $username = '';
private $password = '';
$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