]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/language/class_LanguageSystem.php
Now all base paths are relative and constructed in BaseTemplateEngine genericly,...
[core.git] / inc / classes / main / language / class_LanguageSystem.php
index fe66586aadaae8a5240595705bc910090b8259c4..9174badb31ef745a44f7d1ae3b820dd319459047 100644 (file)
@@ -26,7 +26,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
        /**
         * The full-qualified base path for the language include files
         */
-       private $basePath = '';
+       private $languageBasePath = '';
 
        /**
         * The 2-char language code
@@ -60,36 +60,36 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
        /**
         * Creates an instance of the class LanguageSystem and prepares it for usage
         *
-        * @param       $basePath               The local base path for all language strings
+        * @param       $languageBasePath       The local base path for all language strings
         * @return      $langInstance   An instance of LanguageSystem
-        * @throws      LanguagePathIsEmptyException            If the provided $basePath is empty
-        * @throws      InvalidLanguagePathStringException      If $basePath is no string
-        * @throws      LanguagePathIsNoDirectoryException      If $basePath is no
+        * @throws      LanguagePathIsEmptyException    If the provided $languageBasePath is empty
+        * @throws      InvalidLanguagePathStringException      If $languageBasePath is no string
+        * @throws      LanguagePathIsNoDirectoryException      If $languageBasePath is no
         *                                                                              directory or not found
-        * @throws      LanguagePathReadProtectedException      If $basePath is
+        * @throws      LanguagePathReadProtectedException      If $languageBasePath is
         *                                                                              read-protected
         */
-       public final static function createLanguageSystem ($basePath) {
+       public final static function createLanguageSystem ($languageBasePath) {
                // Get a new instance
                $langInstance = new LanguageSystem();
 
                // Is the base path valid?
-               if (empty($basePath)) {
+               if (empty($languageBasePath)) {
                        // Language path is empty
                        throw new LanguagePathIsEmptyException($langInstance, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!is_string($basePath)) {
+               } elseif (!is_string($languageBasePath)) {
                        // Is not a string
-                       throw new InvalidLanguagePathStringException(array($langInstance, $basePath), self::EXCEPTION_INVALID_STRING);
-               } elseif (!is_dir($basePath)) {
+                       throw new InvalidLanguagePathStringException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_STRING);
+               } elseif (!is_dir($languageBasePath)) {
                        // Is not a path
-                       throw new LanguagePathIsNoDirectoryException(array($langInstance, $basePath), self::EXCEPTION_INVALID_PATH_NAME);
-               } elseif (!is_readable($basePath)) {
+                       throw new LanguagePathIsNoDirectoryException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_PATH_NAME);
+               } elseif (!is_readable($languageBasePath)) {
                        // Is not readable
-                       throw new LanguagePathReadProtectedException(array($langInstance, $basePath), self::EXCEPTION_READ_PROTECED_PATH);
+                       throw new LanguagePathReadProtectedException(array($langInstance, $languageBasePath), self::EXCEPTION_READ_PROTECED_PATH);
                }
 
                // Set the base path
-               $langInstance->setBasePath($basePath);
+               $langInstance->setLanguageBasePath($languageBasePath);
 
                // Initialize the variable stack
                $langInstance->initLanguageStrings();
@@ -107,7 +107,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
        /**
         * Singleton getter for this instance
         *
-        * @return      $thisInstance           An instance of this class
+        * @return      $thisInstance   An instance of this class
         */
        public final static function getInstance () {
                return self::$thisInstance;
@@ -116,18 +116,18 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
        /**
         * Setter for base path
         *
-        * @param               $basePath               The local base path for all templates
+        * @param       $languageBasePath       The relative base path for all language files
         * @return      void
         */
-       protected final function setBasePath ($basePath) {
+       protected final function setLanguageBasePath ($languageBasePath) {
                // And set it
-               $this->basePath = (string) $basePath;
+               $this->languageBasePath = (string) $languageBasePath;
        }
 
        /**
         * Setter for language code
         *
-        * @param               $langCode               The language code for the current application
+        * @param       $langCode       The language code for the current application
         * @return      void
         */
        protected final function setLanguageCode ($langCode) {
@@ -150,7 +150,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
        /**
         * Getter for language code
         *
-        * @return      $langCode               The language code for the current application
+        * @return      $langCode       The language code for the current application
         */
        public final function getLanguageCode () {
                return $this->langCode;