* @param $languageBasePath The local base path for all language strings or emty for auto-detection
* @return $langInstance An instance of LanguageSystem
* @throws InvalidArgumentException If languageBasePath remains empty (@TODO Get rid of that old-lost code)
- * @throws InvalidLanguagePathStringException If $languageBasePath is no string
- * @throws LanguagePathIsNoDirectoryException If $languageBasePath is no
+ * @throws InvalidArgumentException If $languageBasePath is no string
+ * @throws InvalidArgumentException If $languageBasePath is no
* directory or not found
- * @throws LanguagePathReadProtectedException If $languageBasePath is
+ * @throws InvalidArgumentException If $languageBasePath is
* read-protected
*/
public static final function createLanguageSystem (string $languageBasePath = '') {
throw new InvalidArgumentException('languageBasePath is still empty');
} elseif (!is_string($languageBasePath)) {
// Is not a string
- throw new InvalidLanguagePathStringException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_STRING);
+ throw new InvalidArgumentException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_STRING);
} elseif (!is_dir($languageBasePath)) {
// Is not a path
- throw new LanguagePathIsNoDirectoryException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_PATH_NAME);
+ throw new InvalidArgumentException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_PATH_NAME);
} elseif (!is_readable($languageBasePath)) {
// Is not readable
- throw new LanguagePathReadProtectedException(array($langInstance, $languageBasePath), self::EXCEPTION_READ_PROTECED_PATH);
+ throw new InvalidArgumentException(array($langInstance, $languageBasePath), self::EXCEPTION_READ_PROTECED_PATH);
}
// Set the base path
+++ /dev/null
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Deprecated;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Generic\FrameworkException;
-
-/**
- * An exception thrown when the language path string is invalid
- *
- * @author Roland Haeder <webmaster@shipsimu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.shipsimu.org
- * @deprecated Don't use this anymore
- *
- * 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 InvalidLanguagePathStringException extends FrameworkException {
- /**
- * The constructor
- *
- * @param $classArray Array holding exception data
- * @param $code Code number for the exception
- * @return void
- */
- public function __construct (array $classArray, int $code) {
- // Add a message around the missing class
- $message = sprintf('[%s:%d] %s is not a string with path.',
- $classArray[0]->__toString(),
- $this->getLine(),
- $classArray[1]
- );
-
- // Call parent constructor
- parent::__construct($message, $code);
- }
-
-}
+++ /dev/null
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Deprecated;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Generic\FrameworkException;
-
-/**
- * An exception thrown when the language path is no directory
- *
- * @author Roland Haeder <webmaster@shipsimu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.shipsimu.org
- * @todo Don't use this anymore
- *
- * 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 LanguagePathIsNoDirectoryException extends FrameworkException {
- /**
- * The constructor
- *
- * @param $classArray Array holding exception data
- * @param $code Code number for the exception
- * @return void
- */
- public function __construct (array $classArray, int $code) {
- // Add a message around the missing class
- $message = sprintf('[%s:%d] Language base path %s does not exist or is not a directory.',
- $classArray[0]->__toString(),
- $this->getLine(),
- $classArray[1]
- );
-
- // Call parent constructor
- parent::__construct($message, $code);
- }
-
-}
+++ /dev/null
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Deprecated;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Generic\FrameworkException;
-
-/**
- * An exception thrown when the language path is read-protected
- *
- * @author Roland Haeder <webmaster@shipsimu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.shipsimu.org
- * @deprecated Don't use this anymore
- *
- * 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 LanguagePathReadProtectedException extends FrameworkException {
- /**
- * The constructor
- *
- * @param $class Array holding exception data
- * @param $code Code number for the exception
- * @return void
- */
- public function __construct (array $classArray, int $code) {
- // Add a message around the missing class
- $message = sprintf('[%s:%d] Base language path %s is read-protected. Please change access rights (CHMOD).',
- $classArray[0]->__toString(),
- $this->getLine(),
- $classArray[1]
- );
-
- // Call parent constructor
- parent::__construct($message, $code);
- }
-
-}