]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 12 Dec 2021 06:30:30 +0000 (07:30 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 12 Dec 2021 06:30:30 +0000 (07:30 +0100)
- made ClassLoader final as no inheriting classes shall be made (it is generic
  enough)
- renamed ClassLoader->$foundClasses to $pendingFiles as this describes the
  content of the array more closely
- removed some old-lost "// END - if" (WAY more to follow!)

Signed-off-by: Roland Häder <roland@mxchange.org>
28 files changed:
framework/loader/class_ClassLoader.php
framework/main/classes/controller/class_BaseController.php
framework/main/classes/criteria/class_BaseCriteria.php
framework/main/classes/criteria/dataset/class_DataSetCriteria.php
framework/main/classes/filter/auth/class_UserAuthFilter.php
framework/main/classes/filter/change/class_EmailChangeFilter.php
framework/main/classes/filter/change/class_PasswordChangeFilter.php
framework/main/classes/filter/checkboxes/class_RulesAcceptedFilter.php
framework/main/classes/filter/class_FilterChain.php
framework/main/classes/filter/crypto/class_CaptchaEncryptFilter.php
framework/main/classes/filter/guest/class_UserNameIsGuestFilter.php
framework/main/classes/filter/payment/class_PaymentDiscoveryFilter.php
framework/main/classes/filter/validator/class_EmailValidatorFilter.php
framework/main/classes/filter/validator/class_PasswordValidatorFilter.php
framework/main/classes/filter/validator/class_UserNameValidatorFilter.php
framework/main/classes/images/png/class_PngImage.php
framework/main/classes/mailer/class_BaseMailer.php
framework/main/classes/mailer/debug/class_DebugMailer.php
framework/main/classes/streams/crypto/mcrypt/class_McryptStream.php
framework/main/classes/streams/crypto/openssl/class_OpenSslStream.php
framework/main/exceptions/class_FrameworkException.php
framework/main/exceptions/main/class_UnsupportedOperationException.php
framework/main/exceptions/xml/class_InvalidXmlNodeException.php
framework/main/middleware/compressor/class_CompressorChannel.php
framework/main/middleware/debug/class_DebugMiddleware.php
framework/main/middleware/io/class_FileIoHandler.php
framework/main/third_party/api/wernisportal/class_WernisApi.php
index.php

index 3f5271a012315e2b3aace499a437b026c149c7bc..f29e6b63b8a3efd7b6c542754dbc9ff45e6b875f 100644 (file)
@@ -60,16 +60,17 @@ use \SplFileInfo;
  *  - Initial release
  * ----------------------------------
  */
  *  - Initial release
  * ----------------------------------
  */
-class ClassLoader {
+final class ClassLoader {
        /**
         * Instance of this class
         */
        private static $selfInstance = NULL;
 
        /**
        /**
         * Instance of this class
         */
        private static $selfInstance = NULL;
 
        /**
-        * Array with all found classes
+        * Array with all valid but pending for loading file names (class,
+        * interfaces, traits must start with below prefix).
         */
         */
-       private $foundClasses = [];
+       private $pendingFiles = [];
 
        /**
         * List of loaded classes
 
        /**
         * List of loaded classes
@@ -168,7 +169,7 @@ class ClassLoader {
                // Skip here if already cached
                if ($this->listCached === false) {
                        // Writes the cache file of our list away
                // Skip here if already cached
                if ($this->listCached === false) {
                        // Writes the cache file of our list away
-                       $cacheContent = json_encode($this->foundClasses);
+                       $cacheContent = json_encode($this->pendingFiles);
 
                        // Open cache instance
                        $fileObject = $this->listCacheFile->openFile('w');
 
                        // Open cache instance
                        $fileObject = $this->listCacheFile->openFile('w');
@@ -208,25 +209,27 @@ class ClassLoader {
                //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $loaderInstance = self::getSelfInstance();
 
                //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $loaderInstance = self::getSelfInstance();
 
-               // "Cache" configuration instance
+               // "Cache" configuration instance and framework base path
                $configInstance = FrameworkBootstrap::getConfigurationInstance();
                $configInstance = FrameworkBootstrap::getConfigurationInstance();
+               $frameworkBasePath = $configInstance->getConfigEntry('framework_base_path');
 
                // Load all classes
 
                // Load all classes
+               //* NOISY-DEBUG: */ printf('[%s:%d]: frameworkBasePath=%s,self::$frameworkPaths()=%d,' . PHP_EOL, __METHOD__, __LINE__, $frameworkBasePath, count(self::$frameworkPaths));
                foreach (self::$frameworkPaths as $shortPath) {
                        // Generate full path from it
                foreach (self::$frameworkPaths as $shortPath) {
                        // Generate full path from it
-                       //* NOISY-DEBUG: */ printf('[%s:%d]: shortPath=%s' . PHP_EOL, __METHOD__, __LINE__, $shortPath);
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: shortPath[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($shortPath), $shortPath);
                        $realPathName = realpath(sprintf(
                                '%smain%s%s%s',
                        $realPathName = realpath(sprintf(
                                '%smain%s%s%s',
-                               $configInstance->getConfigEntry('framework_base_path'),
+                               $frameworkBasePath,
                                DIRECTORY_SEPARATOR,
                                $shortPath,
                                DIRECTORY_SEPARATOR
                        ));
 
                        // Is it not false and accessible?
                                DIRECTORY_SEPARATOR,
                                $shortPath,
                                DIRECTORY_SEPARATOR
                        ));
 
                        // Is it not false and accessible?
-                       //* NOISY-DEBUG: */ printf('[%s:%d]: realPathName=%s' . PHP_EOL, __METHOD__, __LINE__, $realPathName);
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: realPathName[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($realPathName), $realPathName);
                        if (is_bool($realPathName)) {
                        if (is_bool($realPathName)) {
-                               // Skip this
+                               // Skip this, it is not accessible
                                continue;
                        } elseif (!is_readable($realPathName)) {
                                // @TODO Throw exception instead of break
                                continue;
                        } elseif (!is_readable($realPathName)) {
                                // @TODO Throw exception instead of break
@@ -285,18 +288,14 @@ class ClassLoader {
         * @return      void
         */
        public static function scanTestsClasses () {
         * @return      void
         */
        public static function scanTestsClasses () {
-               // Trace message
-               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
-
                // "Cache" configuration instance
                // "Cache" configuration instance
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $configInstance = FrameworkBootstrap::getConfigurationInstance();
 
                // Load all classes for the application
                foreach (self::$testPaths as $shortPath) {
                $configInstance = FrameworkBootstrap::getConfigurationInstance();
 
                // Load all classes for the application
                foreach (self::$testPaths as $shortPath) {
-                       // Debug message
-                       //* NOISY-DEBUG: */ printf('[%s:%d]: shortPath=%s' . PHP_EOL, __METHOD__, __LINE__, $shortPath);
-
                        // Construct path name
                        // Construct path name
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: shortPath=%s' . PHP_EOL, __METHOD__, __LINE__, $shortPath);
                        $pathName = sprintf(
                                '%s%s%s',
                                $configInstance->getConfigEntry('root_base_path'),
                        $pathName = sprintf(
                                '%s%s%s',
                                $configInstance->getConfigEntry('root_base_path'),
@@ -354,17 +353,24 @@ class ClassLoader {
         * @throws      InvalidArgumentException        If the class' name does not contain a namespace: Tld\Domain\Project is AT LEAST recommended!
         */
        public static function autoLoad (string $className) {
         * @throws      InvalidArgumentException        If the class' name does not contain a namespace: Tld\Domain\Project is AT LEAST recommended!
         */
        public static function autoLoad (string $className) {
-               // The class name should contain at least 2 back-slashes, so split at them
+               // Validate parameter
                //* NOISY-DEBUG: */ printf('[%s:%d] className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className);
                //* NOISY-DEBUG: */ printf('[%s:%d] className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className);
+               if (empty($className)) {
+                       // Should not be empty
+                       throw new InvalidArgumentException('Parameter "className" is empty');
+               }
+
+               // The class name MUST be at least Tld\Domain\Project\Package\SomeFooBar so split at them
                $classNameParts = explode("\\", $className);
 
                // At least 3 parts should be there
                if ((self::$strictNamingConvention === true) && (count($classNameParts) < 5)) {
                $classNameParts = explode("\\", $className);
 
                // At least 3 parts should be there
                if ((self::$strictNamingConvention === true) && (count($classNameParts) < 5)) {
-                       // Namespace scheme is: Project\Package[\SubPackage...]
+                       // Namespace scheme is: Tld\Domain\Project\Package[\SubPackage...]
                        throw new InvalidArgumentException(sprintf('Class name "%s" is not conform to naming-convention: Tld\Domain\Project\Package[\SubPackage...]\SomeFooBar', $className));
                }
 
                // Try to include this class
                        throw new InvalidArgumentException(sprintf('Class name "%s" is not conform to naming-convention: Tld\Domain\Project\Package[\SubPackage...]\SomeFooBar', $className));
                }
 
                // Try to include this class
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Calling self->loadClassFile(%s) ...' . PHP_EOL, __METHOD__, __LINE__, $className);
                self::getSelfInstance()->loadClassFile($className);
 
                // Trace message
                self::getSelfInstance()->loadClassFile($className);
 
                // Trace message
@@ -422,22 +428,16 @@ class ClassLoader {
         */
        protected function scanClassPath (string $basePath, array $ignoreList = [] ) {
                // Is a list has been restored from cache, don't read it again
         */
        protected function scanClassPath (string $basePath, array $ignoreList = [] ) {
                // Is a list has been restored from cache, don't read it again
+               /* NOISY-DEBUG: */ printf('[%s:%d] basePath=%s,ignoreList()=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $basePath, count($ignoreList));
                if ($this->listCached === true) {
                        // Abort here
                if ($this->listCached === true) {
                        // Abort here
+                       /* NOISY-DEBUG: */ printf('[%s:%d] this->listCache=true - EXIT!' . PHP_EOL, __METHOD__, __LINE__);
                        return;
                }
 
                // Keep it in class for later usage
                $this->ignoreList = $ignoreList;
 
                        return;
                }
 
                // Keep it in class for later usage
                $this->ignoreList = $ignoreList;
 
-               /*
-                * Ignore .htaccess by default as it is for protection of directories
-                * on Apache servers.
-                *
-                * @deprecated
-                */
-               array_push($ignoreList, '.htaccess');
-
                /*
                 * Set base directory which holds all our classes, an absolute path
                 * should be used here so is_dir(), is_file() and so on will always
                /*
                 * Set base directory which holds all our classes, an absolute path
                 * should be used here so is_dir(), is_file() and so on will always
@@ -446,6 +446,7 @@ class ClassLoader {
                $basePath2 = realpath($basePath);
 
                // If the basePath is false it is invalid
                $basePath2 = realpath($basePath);
 
                // If the basePath is false it is invalid
+               /* NOISY-DEBUG: */ printf('[%s:%d] basePath2[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($basePath2), $basePath2);
                if ($basePath2 === false) {
                        /* @TODO: Do not exit here. */
                        exit(__METHOD__ . ': Cannot read ' . $basePath . ' !' . PHP_EOL);
                if ($basePath2 === false) {
                        /* @TODO: Do not exit here. */
                        exit(__METHOD__ . ': Cannot read ' . $basePath . ' !' . PHP_EOL);
@@ -472,23 +473,23 @@ class ClassLoader {
                                $iteratorInstance->next();
 
                                // Skip non-file entries
                                $iteratorInstance->next();
 
                                // Skip non-file entries
-                               //* NOISY-DEBUG: */ printf('[%s:%d] SKIP: %s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
+                               //* NOISY-DEBUG: */ printf('[%s:%d] SKIP: fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
                                continue;
                        }
 
                        // Is this file wanted?
                                continue;
                        }
 
                        // Is this file wanted?
-                       //* NOISY-DEBUG: */ printf('[%s:%d] FOUND: %s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
+                       //* NOISY-DEBUG: */ printf('[%s:%d] FOUND: fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
                        if ((substr($fileName, 0, strlen($this->prefix)) == $this->prefix) && (substr($fileName, -strlen($this->suffix), strlen($this->suffix)) == $this->suffix)) {
                                // Add it to the list
                        if ((substr($fileName, 0, strlen($this->prefix)) == $this->prefix) && (substr($fileName, -strlen($this->suffix), strlen($this->suffix)) == $this->suffix)) {
                                // Add it to the list
-                               //* NOISY-DEBUG: */ printf('[%s:%d] ADD: %s,currentEntry=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName, $currentEntry);
-                               $this->foundClasses[$fileName] = $currentEntry;
+                               //* NOISY-DEBUG: */ printf('[%s:%d] ADD: fileName=%s,currentEntry=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName, $currentEntry);
+                               $this->pendingFiles[$fileName] = $currentEntry;
                        } else {
                                // Not added
                        } else {
                                // Not added
-                               //* NOISY-DEBUG: */ printf('[%s:%d] NOT ADDED: %s,currentEntry=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName, $currentEntry);
+                               //* NOISY-DEBUG: */ printf('[%s:%d] NOT ADDED: fileName=%s,currentEntry=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName, $currentEntry);
                        }
 
                        // Advance to next entry
                        }
 
                        // Advance to next entry
-                       //* NOISY-DEBUG: */ printf('[%s:%d] NEXT: %s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
+                       //* NOISY-DEBUG: */ printf('[%s:%d] NEXT: fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
                        $iteratorInstance->next();
                }
        }
                        $iteratorInstance->next();
                }
        }
@@ -521,7 +522,7 @@ class ClassLoader {
                // Is the cache there?
                if (FrameworkBootstrap::isReadableFile($this->listCacheFile)) {
                        // Load and convert it
                // Is the cache there?
                if (FrameworkBootstrap::isReadableFile($this->listCacheFile)) {
                        // Load and convert it
-                       $this->foundClasses = json_decode(file_get_contents($this->listCacheFile->getPathname()));
+                       $this->pendingFiles = json_decode(file_get_contents($this->listCacheFile->getPathname()));
 
                        // List has been restored from cache!
                        $this->listCached = true;
 
                        // List has been restored from cache!
                        $this->listCached = true;
@@ -538,9 +539,10 @@ class ClassLoader {
        }
 
        /**
        }
 
        /**
-        * Tries to find the given class in our list. This method ignores silently
-        * missing classes or interfaces. So if you use class_exists() this method
-        * does not interrupt your program.
+        * Tries to find the given class in our list. It will ignore already loaded 
+        * (to the program available) class/interface/trait files. But you SHOULD
+        * save below "expensive" code by pre-checking this->loadedClasses[], if
+        * possible.
         *
         * @param       $className      The class that shall be loaded
         * @return      void
         *
         * @param       $className      The class that shall be loaded
         * @return      void
@@ -557,22 +559,22 @@ class ClassLoader {
                $fileName = sprintf('%s%s%s', $this->prefix, $shortClassName, $this->suffix);
 
                // Now look it up in our index
                $fileName = sprintf('%s%s%s', $this->prefix, $shortClassName, $this->suffix);
 
                // Now look it up in our index
-               //* NOISY-DEBUG: */ printf('[%s:%d] ISSET: %s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
-               if ((isset($this->foundClasses[$fileName])) && (!isset($this->loadedClasses[$this->foundClasses[$fileName]->getPathname()]))) {
+               //* NOISY-DEBUG: */ printf('[%s:%d] ISSET: fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
+               if ((isset($this->pendingFiles[$fileName])) && (!isset($this->loadedClasses[$this->pendingFiles[$fileName]->getPathname()]))) {
                        // File is found and not loaded so load it only once
                        // File is found and not loaded so load it only once
-                       //* NOISY-DEBUG: */ printf('[%s:%d] LOAD: %s - START' . PHP_EOL, __METHOD__, __LINE__, $fileName);
-                       FrameworkBootstrap::loadInclude($this->foundClasses[$fileName]);
-                       //* NOISY-DEBUG: */ printf('[%s:%d] LOAD: %s - END' . PHP_EOL, __METHOD__, __LINE__, $fileName);
+                       //* NOISY-DEBUG: */ printf('[%s:%d] LOAD: fileName=%s - START' . PHP_EOL, __METHOD__, __LINE__, $fileName);
+                       FrameworkBootstrap::loadInclude($this->pendingFiles[$fileName]);
+                       //* NOISY-DEBUG: */ printf('[%s:%d] LOAD: fileName=%s - END' . PHP_EOL, __METHOD__, __LINE__, $fileName);
 
                        // Count this loaded class/interface/exception
                        $this->total++;
 
                        // Mark this class as loaded for other purposes than loading it.
 
                        // Count this loaded class/interface/exception
                        $this->total++;
 
                        // Mark this class as loaded for other purposes than loading it.
-                       $this->loadedClasses[$this->foundClasses[$fileName]->getPathname()] = true;
+                       $this->loadedClasses[$this->pendingFiles[$fileName]->getPathname()] = true;
 
                        // Remove it from classes list so it won't be found twice.
 
                        // Remove it from classes list so it won't be found twice.
-                       //* NOISY-DEBUG: */ printf('[%s:%d] UNSET: %s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
-                       unset($this->foundClasses[$fileName]);
+                       //* NOISY-DEBUG: */ printf('[%s:%d] UNSET: fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
+                       unset($this->pendingFiles[$fileName]);
 
                        // Developer mode excludes caching (better debugging)
                        if (!FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled')) {
 
                        // Developer mode excludes caching (better debugging)
                        if (!FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled')) {
@@ -582,8 +584,11 @@ class ClassLoader {
                        }
                } else {
                        // Not found
                        }
                } else {
                        // Not found
-                       //* NOISY-DEBUG: */ printf('[%s:%d] 404: %s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
+                       //* NOISY-DEBUG: */ printf('[%s:%d] 404: fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
                }
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d] EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
 }
        }
 
 }
index 140379907a26128393ea382cf51c2225d2a13274..5f1d42e46e12b455074b57e7dffd97f60ee854cf 100644 (file)
@@ -141,7 +141,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
 
                        // Execute *very* generic post filters
                        $this->executePostFilters($requestInstance, $responseInstance);
 
                        // Execute *very* generic post filters
                        $this->executePostFilters($requestInstance, $responseInstance);
-               } // END - if
+               }
 
                // Flush the buffer out
                $responseInstance->flushBuffer();
 
                // Flush the buffer out
                $responseInstance->flushBuffer();
@@ -214,7 +214,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
                if (!isset($this->filterChains[$filterChain])) {
                        // Throw an exception here
                        throw new InvalidFilterChainException(array($this, $filterChain), self::EXCEPTION_FILTER_CHAIN_INVALID);
                if (!isset($this->filterChains[$filterChain])) {
                        // Throw an exception here
                        throw new InvalidFilterChainException(array($this, $filterChain), self::EXCEPTION_FILTER_CHAIN_INVALID);
-               } // END - if
+               }
 
                // Add the filter
                $this->filterChains[$filterChain]->addFilter($filterInstance);
 
                // Add the filter
                $this->filterChains[$filterChain]->addFilter($filterInstance);
@@ -267,7 +267,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
                if (!isset($this->filterChains[$filterChain])) {
                        // Throw an exception here
                        throw new InvalidFilterChainException(array($this, $filterChain), self::EXCEPTION_FILTER_CHAIN_INVALID);
                if (!isset($this->filterChains[$filterChain])) {
                        // Throw an exception here
                        throw new InvalidFilterChainException(array($this, $filterChain), self::EXCEPTION_FILTER_CHAIN_INVALID);
-               } // END - if
+               }
 
                // Run all filters
                $this->filterChains[$filterChain]->processFilters($requestInstance, $responseInstance);
 
                // Run all filters
                $this->filterChains[$filterChain]->processFilters($requestInstance, $responseInstance);
index a477e0722641773e68ba01e1cc936c7a1574d150..9331121ce29431f00ba316ab51dc2f5df7e53b78 100644 (file)
@@ -291,7 +291,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                if ($this->isKeySet($criteriaType, $criteriaKey)) {
                        // Then use it
                        $value = $this->getGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey);
                if ($this->isKeySet($criteriaType, $criteriaKey)) {
                        // Then use it
                        $value = $this->getGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey);
-               } // END - if
+               }
 
                // Return the value
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: value=' . $value . ' - EXIT!');
 
                // Return the value
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: value=' . $value . ' - EXIT!');
@@ -352,7 +352,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                                if (($key == $criteriaKey) && ($criteriaValue == $entry)) {
                                        // Then count this one up
                                        $counted++;
                                if (($key == $criteriaKey) && ($criteriaValue == $entry)) {
                                        // Then count this one up
                                        $counted++;
-                               } // END - if
+                               }
                        } // END - foreach
                } // END - foreach
 
                        } // END - foreach
                } // END - foreach
 
@@ -420,7 +420,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                                        $criteriaKey,
                                        urlencode($criteriaValue)
                                );
                                        $criteriaKey,
                                        urlencode($criteriaValue)
                                );
-                       } // END - if
+                       }
                } // END - foreach
 
                // Remove last semicolon
                } // END - foreach
 
                // Remove last semicolon
@@ -435,8 +435,8 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                                        $this->getLimit(),
                                        $this->getSkip()
                                );
                                        $this->getLimit(),
                                        $this->getSkip()
                                );
-                       } // END - if
-               } // END - if
+                       }
+               }
 
                // Return the cache key
                return $cacheKey;
 
                // Return the cache key
                return $cacheKey;
index f970fc50114fed906f568f25db41dcd5b526dee8..5413cfeae992fb5fa9ef286ebcb92349fd509fd8 100644 (file)
@@ -252,7 +252,7 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
                if (empty($primaryKey)) {
                        // Get uniqueKey
                        $primaryKey = $this->getUniqueKey();
                if (empty($primaryKey)) {
                        // Get uniqueKey
                        $primaryKey = $this->getUniqueKey();
-               } // END - if
+               }
 
                // Return it
                return $primaryKey;
 
                // Return it
                return $primaryKey;
index 985df48f40eb19056eb671e037dcc4f9910bb396..d902899bd1b3433cbfcf4db397c4f359cd356d23 100644 (file)
@@ -110,7 +110,7 @@ class UserAuthFilter extends BaseFilter implements Filterable {
 
                        // Stop here
                        throw new UserAuthorizationException($this, self::EXCEPTION_AUTH_DATA_INVALID);
 
                        // Stop here
                        throw new UserAuthorizationException($this, self::EXCEPTION_AUTH_DATA_INVALID);
-               } // END - if
+               }
 
                // Regular user account
                $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_class');
 
                // Regular user account
                $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_class');
@@ -121,13 +121,13 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                        // Set class
                        $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_class');
                        $methodName = 'createGuestByUserName';
                        // Set class
                        $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_class');
                        $methodName = 'createGuestByUserName';
-               } // END - if
+               }
 
                // Does the guest class exist?
                if (!class_exists($className)) {
                        // Then abort here
                        throw new NoClassException (array($this, $className), self::EXCEPTION_CLASS_NOT_FOUND);
 
                // Does the guest class exist?
                if (!class_exists($className)) {
                        // Then abort here
                        throw new NoClassException (array($this, $className), self::EXCEPTION_CLASS_NOT_FOUND);
-               } // END - if
+               }
 
                // Now try the dynamic login
                $userInstance = call_user_func_array(array($className, $methodName), array($authLogin));
 
                // Now try the dynamic login
                $userInstance = call_user_func_array(array($className, $methodName), array($authLogin));
@@ -136,7 +136,7 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                if ($userInstance->getPasswordHash() !== $authHash) {
                        // Mismatching password
                        throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
                if ($userInstance->getPasswordHash() !== $authHash) {
                        // Mismatching password
                        throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
-               } // END - if
+               }
 
                // Remember auth and user instances in registry
                GenericRegistry::getRegistry()->addInstance('auth', $authInstance);
 
                // Remember auth and user instances in registry
                GenericRegistry::getRegistry()->addInstance('auth', $authInstance);
index 7a228badbde413b32a32fbcd38118053da262925..1b4600af2bceef6896c604f01eb19bddb305e986 100644 (file)
@@ -80,7 +80,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
+               }
 
                // Is only second email set?
                if ((empty($email1)) && (!empty($email2))) {
 
                // Is only second email set?
                if ((empty($email1)) && (!empty($email2))) {
@@ -92,7 +92,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
+               }
 
                // Do both match?
                if ($email1 != $email2) {
 
                // Do both match?
                if ($email1 != $email2) {
@@ -104,13 +104,13 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
+               }
 
                // Are email and confirmation empty?
                if ((empty($email1)) && (empty($email2))) {
                        // No email change required!
                        return true;
 
                // Are email and confirmation empty?
                if ((empty($email1)) && (empty($email2))) {
                        // No email change required!
                        return true;
-               } // END - if
+               }
 
                // Now, get a user instance for comparison
                $userInstance = GenericRegistry::getRegistry()->getInstance('user');
 
                // Now, get a user instance for comparison
                $userInstance = GenericRegistry::getRegistry()->getInstance('user');
@@ -122,7 +122,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                if ($userEmail == $email1) {
                        // Nothing has been changed is fine...
                        return true;
                if ($userEmail == $email1) {
                        // Nothing has been changed is fine...
                        return true;
-               } // END - if
+               }
 
                // Update the "new_email" field
                $this->partialStub('Unfinished part.');
 
                // Update the "new_email" field
                $this->partialStub('Unfinished part.');
index 40f2c4af9e489b7b16a4e9124a0eb182bb76760d..e00c3543d977ffe28daa1132c36433379ee78335 100644 (file)
@@ -81,7 +81,7 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
+               }
 
                // Is only second pass set?
                if ((empty($pass1)) && (!empty($pass2))) {
 
                // Is only second pass set?
                if ((empty($pass1)) && (!empty($pass2))) {
@@ -93,13 +93,13 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
+               }
 
                // Are password and confirmation empty?
                if ((empty($pass1)) && (empty($pass2))) {
                        // Don't change password here
                        return true;
 
                // Are password and confirmation empty?
                if ((empty($pass1)) && (empty($pass2))) {
                        // Don't change password here
                        return true;
-               } // END - if
+               }
 
                // Do both match?
                if ($pass1 != $pass2) {
 
                // Do both match?
                if ($pass1 != $pass2) {
@@ -111,7 +111,7 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
 
                        // Stop processing here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
+               }
 
                // Now, get a user instance for comparison
                $userInstance = GenericRegistry::getRegistry()->getInstance('user');
 
                // Now, get a user instance for comparison
                $userInstance = GenericRegistry::getRegistry()->getInstance('user');
index 7672f48dd7ca909bb60434a226286f1931e9d847..ad02224500e09668742cf8aa5ecae645ad0d9eb7 100644 (file)
@@ -79,7 +79,7 @@ class RulesAcceptedFilter extends BaseFilter implements Filterable {
 
                        // Skip further processing
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
 
                        // Skip further processing
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
+               }
        }
 
 }
        }
 
 }
index 807a2cafeeb5de0dd49aac9563cdd8072ad513f5..da922dd1fb5fa207a21ec06122fc9f38ab3289a9 100644 (file)
@@ -89,7 +89,7 @@ class FilterChain extends BaseFrameworkSystem implements Registerable {
                if ($this->isValidGenericArrayKey('filters', 'generic', 'dummy')) {
                        // Then get them
                        $filters = $this->getGenericArrayKey('filters', 'generic', 'dummy');
                if ($this->isValidGenericArrayKey('filters', 'generic', 'dummy')) {
                        // Then get them
                        $filters = $this->getGenericArrayKey('filters', 'generic', 'dummy');
-               } // END - if
+               }
 
                // Return it
                return $filters;
 
                // Return it
                return $filters;
@@ -108,7 +108,7 @@ class FilterChain extends BaseFrameworkSystem implements Registerable {
                if ($this->isValidGenericArrayKey('filters', 'post', 'dummy')) {
                        // Then get them
                        $filters = $this->getGenericArrayKey('filters', 'post', 'dummy');
                if ($this->isValidGenericArrayKey('filters', 'post', 'dummy')) {
                        // Then get them
                        $filters = $this->getGenericArrayKey('filters', 'post', 'dummy');
-               } // END - if
+               }
 
                // Return it
                return $filters;
 
                // Return it
                return $filters;
index 4326a052b3211829d4be1baf3e36a790ba21cc17..377aab8e603a1b60365b6f9478a56481a1db8c1d 100644 (file)
@@ -76,7 +76,7 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable {
 
                        // Throw exception
                        throw new EncryptMissingException($this, CryptoHelper::EXCEPTION_ENCRYPT_MISSING);
 
                        // Throw exception
                        throw new EncryptMissingException($this, CryptoHelper::EXCEPTION_ENCRYPT_MISSING);
-               } // END - if
+               }
 
                // Decode it fully
                $encryptDecoded = base64_decode(str_replace(' ', '+', urldecode($encryptRequest)));
 
                // Decode it fully
                $encryptDecoded = base64_decode(str_replace(' ', '+', urldecode($encryptRequest)));
@@ -91,7 +91,7 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable {
 
                        // Throw exception
                        throw new EncryptInvalidLengthException($this, CryptoHelper::EXCEPTION_ENCRYPT_INVALID);
 
                        // Throw exception
                        throw new EncryptInvalidLengthException($this, CryptoHelper::EXCEPTION_ENCRYPT_INVALID);
-               } // END - if
+               }
 
                // Write it to the request
                $requestInstance->setRequestElement('decrypted', $decryptedString);
 
                // Write it to the request
                $requestInstance->setRequestElement('decrypted', $decryptedString);
index c815e0c5fac403be043a36e5eba435b503120fd7..4038c7eba8d254630e91547ba68f50ea3bcbf603 100644 (file)
@@ -72,7 +72,7 @@ class UserNameIsGuestFilter extends BaseFilter implements Filterable {
                        // Then set the password to the configured password
                        $requestInstance->setRequestElement('pass1', FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_passwd'));
                        $requestInstance->setRequestElement('pass2', FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_passwd'));
                        // Then set the password to the configured password
                        $requestInstance->setRequestElement('pass1', FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_passwd'));
                        $requestInstance->setRequestElement('pass2', FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_passwd'));
-               } // END - if
+               }
        }
 
 }
        }
 
 }
index d10bf90f1a60dd2ba05ac3e68637e0a79e2c3d60..a09870f25b14cd64c649039a7bd8061dafa0e2dd 100644 (file)
@@ -73,7 +73,7 @@ class PaymentDiscoveryFilter extends BaseFilter implements Filterable {
                if (is_null($resolverInstance)) {
                        // Throw an exception here
                        throw new NullPointerException($filterInstance, self::EXCEPTION_IS_NULL_POINTER);
                if (is_null($resolverInstance)) {
                        // Throw an exception here
                        throw new NullPointerException($filterInstance, self::EXCEPTION_IS_NULL_POINTER);
-               } // END - if
+               }
 
                // Get the action name from resolver
                $actionName = $resolverInstance->getActionName();
 
                // Get the action name from resolver
                $actionName = $resolverInstance->getActionName();
index 6721c4fd77fad87ec02a99ee408802ee15a3d1e2..8d1d827c93114bfc57aedea2c353acd2630752b1 100644 (file)
@@ -96,13 +96,13 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                                if (empty($email1)) {
                                        // Add a message to the response
                                        $responseInstance->addFatalMessage('email1_empty');
                                if (empty($email1)) {
                                        // Add a message to the response
                                        $responseInstance->addFatalMessage('email1_empty');
-                               } // END - if
+                               }
 
                                // Is the confirmation empty?
                                if (empty($email2)) {
                                        // Add a message to the response
                                        $responseInstance->addFatalMessage('email2_empty');
 
                                // Is the confirmation empty?
                                if (empty($email2)) {
                                        // Add a message to the response
                                        $responseInstance->addFatalMessage('email2_empty');
-                               } // END - if
+                               }
 
                                // Abort here
                                throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
 
                                // Abort here
                                throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
index 1e2b226479ee2ec904e4674939c03eeef66acdcf..d910bdf7d4ad764904927f395a2d20f18b12ab62 100644 (file)
@@ -87,13 +87,13 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable {
                        if (empty($password1)) {
                                // Add a message to the response
                                $responseInstance->addFatalMessage('pass1_empty');
                        if (empty($password1)) {
                                // Add a message to the response
                                $responseInstance->addFatalMessage('pass1_empty');
-                       } // END - if
+                       }
 
                        // Is the confirmation empty?
                        if (empty($password2)) {
                                // Add a message to the response
                                $responseInstance->addFatalMessage('pass2_empty');
 
                        // Is the confirmation empty?
                        if (empty($password2)) {
                                // Add a message to the response
                                $responseInstance->addFatalMessage('pass2_empty');
-                       } // END - if
+                       }
 
                        // Abort here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
 
                        // Abort here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
index ccb2f196cd2f51405a751632725d2a00c8d55769..97eb61dfdfe2b0d73a4b20cbf45b1b6400132893 100644 (file)
@@ -141,7 +141,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
                        // This username is still available
                        $alreadyTaken = false;
                if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
                        // This username is still available
                        $alreadyTaken = false;
-               } // END - if
+               }
 
                // Return the result
                return $alreadyTaken;
 
                // Return the result
                return $alreadyTaken;
index 3189809c07b6d315112efbc902bbc7efdb737e2b..3d41351a1f556a61969178b4b241a4a8214856fb 100644 (file)
@@ -82,7 +82,7 @@ class PngImage extends BaseImage {
                if (FrameworkBootstrap::isReadableFile($cacheFile)) {
                        // Remove it
                        unlink($cacheFile->getPathname());
                if (FrameworkBootstrap::isReadableFile($cacheFile)) {
                        // Remove it
                        unlink($cacheFile->getPathname());
-               } // END - if
+               }
 
                // Finish the image and send it to a cache file
                imagepng($this->getImageResource(), $cacheFile->getPathname(), 9, PNG_ALL_FILTERS);
 
                // Finish the image and send it to a cache file
                imagepng($this->getImageResource(), $cacheFile->getPathname(), 9, PNG_ALL_FILTERS);
index 4c71822b1df30122e8cfbdddabb8b4086216948c..2715763a72ab10c66dfabb5c613cbdef0e5808e2 100644 (file)
@@ -176,7 +176,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
                if ((!empty($templateName)) && ($this->isGenericArrayElementSet('recipients', $templateName, 'generic', 'subject'))) {
                        // Then use it
                        $subjectLine = $this->getGenericArrayElement('recipients', $templateName, 'generic', 'subject');
                if ((!empty($templateName)) && ($this->isGenericArrayElementSet('recipients', $templateName, 'generic', 'subject'))) {
                        // Then use it
                        $subjectLine = $this->getGenericArrayElement('recipients', $templateName, 'generic', 'subject');
-               } // END - if
+               }
 
                // Return it
                return $subjectLine;
 
                // Return it
                return $subjectLine;
index c73e3716c12e9204ef2aae2586868b80c3446ad1..a1e58a5182557a6052ff49666c80dd61c51cafc9 100644 (file)
@@ -101,7 +101,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
                                foreach ($recipientList['config_vars'] as $variable => $dummy) {
                                        // Load the config value and set it
                                        $templateInstance->assignConfigVariable($variable);
                                foreach ($recipientList['config_vars'] as $variable => $dummy) {
                                        // Load the config value and set it
                                        $templateInstance->assignConfigVariable($variable);
-                               } // END - if
+                               }
 
                                // Now do the same with the values but ask the "value instance" instead!
                                foreach ($recipientList['value_vars'] as $variable => $dummy) {
 
                                // Now do the same with the values but ask the "value instance" instead!
                                foreach ($recipientList['value_vars'] as $variable => $dummy) {
@@ -109,7 +109,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
                                        if (!isset($recipientList['values'][$variable])) {
                                                // Throw exception
                                                throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
                                        if (!isset($recipientList['values'][$variable])) {
                                                // Throw exception
                                                throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
-                                       } // END - if
+                                       }
 
                                        // Get the field from the value instance
                                        $fieldValue = $recipientList['values'][$variable]->getField($variable);
 
                                        // Get the field from the value instance
                                        $fieldValue = $recipientList['values'][$variable]->getField($variable);
index 6499f57690b3e6d953b575668e595f18eb26cbff..e166dcaec08590346176ab51001874a28aa3ec90 100644 (file)
@@ -78,7 +78,7 @@ class McryptStream extends BaseCryptoStream implements EncryptableStream {
                if (is_null($key)) {
                        // None provided
                        $key = $this->getRngInstance()->generateKey();
                if (is_null($key)) {
                        // None provided
                        $key = $this->getRngInstance()->generateKey();
-               } // END - if
+               }
 
                // Add some "payload" to the string
                switch ($this->getRngInstance()->randomNumber(0, 8)) {
 
                // Add some "payload" to the string
                switch ($this->getRngInstance()->randomNumber(0, 8)) {
@@ -142,7 +142,7 @@ class McryptStream extends BaseCryptoStream implements EncryptableStream {
                if (is_null($key)) {
                        // Generate (default) key
                        $key = $this->getRngInstance()->generateKey();
                if (is_null($key)) {
                        // Generate (default) key
                        $key = $this->getRngInstance()->generateKey();
-               } // END - if
+               }
 
                // Decrypt the string
                $payloadString = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_ECB, $iv);
 
                // Decrypt the string
                $payloadString = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_ECB, $iv);
index 11d0f95fbcf285f1193dd611180d8e77b63c480a..124898926fb2717c300e1362aff8bb2821cf0cdd 100644 (file)
@@ -80,7 +80,7 @@ class OpenSslStream extends BaseCryptoStream implements EncryptableStream {
                if (is_null($key)) {
                        // None provided
                        $key = $this->getRngInstance()->generateKey();
                if (is_null($key)) {
                        // None provided
                        $key = $this->getRngInstance()->generateKey();
-               } // END - if
+               }
 
                // Add some "payload" to the string
                switch ($this->getRngInstance()->randomNumber(0, 8)) {
 
                // Add some "payload" to the string
                switch ($this->getRngInstance()->randomNumber(0, 8)) {
@@ -147,7 +147,7 @@ class OpenSslStream extends BaseCryptoStream implements EncryptableStream {
                if (is_null($key)) {
                        // Generate (default) key
                        $key = $this->getRngInstance()->generateKey();
                if (is_null($key)) {
                        // Generate (default) key
                        $key = $this->getRngInstance()->generateKey();
-               } // END - if
+               }
 
                // Decrypt the string
                $payloadString = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_ECB, $iv);
 
                // Decrypt the string
                $payloadString = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_ECB, $iv);
index b63ee64a76a6d34d6e3b1109d319df140ace85d8..d7bbe1c49d8282c5caa0972369c7e4257fcf18f5 100644 (file)
@@ -66,7 +66,7 @@ abstract class FrameworkException extends ReflectionException {
 
                        // End here
                        exit();
 
                        // End here
                        exit();
-               } // END - if
+               }
 
                // Should we log exceptions? (bad implementation)
                if (defined('LOG_EXCEPTIONS')) {
 
                // Should we log exceptions? (bad implementation)
                if (defined('LOG_EXCEPTIONS')) {
@@ -77,7 +77,7 @@ abstract class FrameworkException extends ReflectionException {
                                $message,
                                $this->getHexCode()
                        ));
                                $message,
                                $this->getHexCode()
                        ));
-               } // END - if
+               }
        }
 
        /**
        }
 
        /**
@@ -128,12 +128,12 @@ abstract class FrameworkException extends ReflectionException {
                                        // Add only non-array elements
                                        if (!is_array($debug)) {
                                                $info .= $debug . ', ';
                                        // Add only non-array elements
                                        if (!is_array($debug)) {
                                                $info .= $debug . ', ';
-                                       } // END - if
+                                       }
                                } // END - foreach
 
                                // Remove last chars (commata, space)
                                $info = substr($info, 0, -2);
                                } // END - foreach
 
                                // Remove last chars (commata, space)
                                $info = substr($info, 0, -2);
-                       } // END - if
+                       }
 
                        // Prepare argument infos
                        $info = '<em id="debug_args_' . $dbgIndex . '">' . $info . '</em>';
 
                        // Prepare argument infos
                        $info = '<em id="debug_args_' . $dbgIndex . '">' . $info . '</em>';
@@ -142,17 +142,17 @@ abstract class FrameworkException extends ReflectionException {
                        $file = 'Unknown file';
                        if (isset($dbgInfo['file'])) {
                                $file = basename($dbgInfo['file']);
                        $file = 'Unknown file';
                        if (isset($dbgInfo['file'])) {
                                $file = basename($dbgInfo['file']);
-                       } // END - if
+                       }
 
                        // Line detection
                        $line = 'Unknown line';
                        if (isset($dbgInfo['line'])) {
                                $line = 'line ' . $dbgInfo['line'];
 
                        // Line detection
                        $line = 'Unknown line';
                        if (isset($dbgInfo['line'])) {
                                $line = 'line ' . $dbgInfo['line'];
-                       } // END - if
+                       }
 
                        // The message
                        $dbgMsg .= "\t at <em id=\"debug_id_".$dbgIndex."\">".$dbgIndex."</em> <em id=\"debug_file_".$dbgIndex."\">".$file."</em> (<em id=\"debug_line_".$dbgIndex."\">".$line."</em>) -&gt; ".$dbgInfo['function'].'('.$info.")<br />\n";
 
                        // The message
                        $dbgMsg .= "\t at <em id=\"debug_id_".$dbgIndex."\">".$dbgIndex."</em> <em id=\"debug_file_".$dbgIndex."\">".$file."</em> (<em id=\"debug_line_".$dbgIndex."\">".$line."</em>) -&gt; ".$dbgInfo['function'].'('.$info.")<br />\n";
-               } // END - if
+               }
 
                // Add end-message
                $dbgMsg .= "Debug backtrace end<br />\n";
 
                // Add end-message
                $dbgMsg .= "Debug backtrace end<br />\n";
index 3cebaf5fe2e4a950eb625bb3789be9fd9739c2c0..54952640967205e83a0fa6c56e5eeb1e007265ba 100644 (file)
@@ -45,7 +45,7 @@ class UnsupportedOperationException extends FrameworkException {
                if ((isset($classArray[2])) && ($classArray[2] instanceof FrameworkInterface)) {
                        // Get the class name
                        $extraClassName = $classArray[2]->__toString();
                if ((isset($classArray[2])) && ($classArray[2] instanceof FrameworkInterface)) {
                        // Get the class name
                        $extraClassName = $classArray[2]->__toString();
-               } // END - if
+               }
 
                // Add a message around the missing class
                $message = sprintf('[%s:%d] Method <u>%s()</u> is unsupported or should not be called. extraInstance=%s',
 
                // Add a message around the missing class
                $message = sprintf('[%s:%d] Method <u>%s()</u> is unsupported or should not be called. extraInstance=%s',
index 9d437a7f281988a8072699b9c5e9f3b551ddaa2c..bbeb43dc82dd6a6c9e262d8cfd1401337ca291ef 100644 (file)
@@ -40,7 +40,7 @@ class InvalidXmlNodeException extends FrameworkException {
                $attributes = '<em>None</em>';
                if ((is_array($classArray[2])) && (count($classArray[2]) > 0)) {
                        $attributes = implode(', ', $classArray[2]);
                $attributes = '<em>None</em>';
                if ((is_array($classArray[2])) && (count($classArray[2]) > 0)) {
                        $attributes = implode(', ', $classArray[2]);
-               } // END - if
+               }
 
                // Construct our message
                $message = sprintf('[%s:%d] Invalid XML node found: %s, attributes: %s.',
 
                // Construct our message
                $message = sprintf('[%s:%d] Invalid XML node found: %s, attributes: %s.',
index 09d015374f06f5ee4afec9d338eac3439c8f7b32..798f6e48e559d1da9439558148f0148b0482845d 100644 (file)
@@ -98,19 +98,19 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
                                        if (is_null($tempInstance)) {
                                                // Then skip to the next one
                                                continue;
                                        if (is_null($tempInstance)) {
                                                // Then skip to the next one
                                                continue;
-                                       } // END - if
+                                       }
 
                                        // Set the compressor
                                        $compressorInstance->setCompressor($tempInstance);
 
                                        // No more searches required because we have found a valid compressor stream
                                        break;
 
                                        // Set the compressor
                                        $compressorInstance->setCompressor($tempInstance);
 
                                        // No more searches required because we have found a valid compressor stream
                                        break;
-                               } // END - if
+                               }
                        } // END - while
 
                        // Close the directory
                        $directoryInstance->closeDirectory();
                        } // END - while
 
                        // Close the directory
                        $directoryInstance->closeDirectory();
-               } // END - if
+               }
 
                // Check again if there is a compressor
                if (
 
                // Check again if there is a compressor
                if (
@@ -121,7 +121,7 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
                        // Set the null compressor handler. This should not be configureable!
                        // @TODO Is there a configurable fall-back compressor needed, or is NullCompressor okay?
                        $compressorInstance->setCompressor(ObjectFactory::createObjectByName('Org\Mxchange\CoreFramework\Compressor\Null\NullCompressor'));
                        // Set the null compressor handler. This should not be configureable!
                        // @TODO Is there a configurable fall-back compressor needed, or is NullCompressor okay?
                        $compressorInstance->setCompressor(ObjectFactory::createObjectByName('Org\Mxchange\CoreFramework\Compressor\Null\NullCompressor'));
-               } // END - if
+               }
 
                // Return the compressor instance
                return $compressorInstance;
 
                // Return the compressor instance
                return $compressorInstance;
index 3a7913b374f8c7940492c709d2bdba4a907779e9..326a692db2371368a41dbe3b148f149423a5f801 100644 (file)
@@ -89,7 +89,7 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
                if ($isInitialized === true) {
                        // Then set class name
                        $debugInstance->getOutputInstance()->setLoggerClassName($className);
                if ($isInitialized === true) {
                        // Then set class name
                        $debugInstance->getOutputInstance()->setLoggerClassName($className);
-               } // END - if
+               }
 
                // Return instance
                return $debugInstance;
 
                // Return instance
                return $debugInstance;
index 7cd6e7624f69372cf6809c826e1fcaee34f01616..55e47eb42520d01ea904e5269a09ea8e216575ef 100644 (file)
@@ -117,7 +117,7 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
                if ($objectInstance instanceof FrameworkInterface) {
                        // Then use this
                        $className = $objectInstance->__toString();
                if ($objectInstance instanceof FrameworkInterface) {
                        // Then use this
                        $className = $objectInstance->__toString();
-               } // END - if
+               }
 
                // Prepare output array
                $dataArray = array(
 
                // Prepare output array
                $dataArray = array(
index a37e7b1196a049bf5ae564666deae9f666b34af9..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 100644 (file)
@@ -1,427 +1,2 @@
 <?php
 <?php
-// Own namespace
-namespace Com\Wds66\Api;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-
-/**
- * Class for connecting to the Wernis-Portal at http://www.wds66.com
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- * @todo               Out-dated since 0.6-BETA
- *
- * 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 WernisApi extends BaseFrameworkSystem {
-       /**
-        * Static base API URL
-        */
-       private static $apiUrl = 'https://www.wds66.com/api/';
-
-       /**
-        * API Wernis amount
-        */
-       private $wernis_amount = 0;
-
-       /**
-        * API username
-        */
-       private $w_id = 0;
-
-       /**
-        * API Wernis password (not account password!)
-        */
-       private $w_md5 = '';
-
-       /**
-        * Nickname of the user
-        */
-       private $w_nick = '';
-
-       /**
-        * Wernis amount of the user
-        */
-       private $w_amount = 0;
-
-       /**
-        * Array with status informations
-        */
-       private $statusArray = array();
-
-       /**
-        * Status for 'okay'
-        */
-       private $statusOkay = 'OK';
-
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this API class
-        *
-        * @param       $configArray                    Configuration array
-        * @return      $apiInstance    An instance of this API class
-        */
-       public static final function createWernisApi (array $configArray) {
-               // Create a new instance
-               $apiInstance = new WernisApi();
-
-               // If not an api_url is given (e.g. on local development system)
-               if (!isset($configArray['api_url'])) {
-                       // ... then set the productive URL
-                       $configArray['api_url'] = self::$apiUrl;
-               }
-
-               // Konfiguration uebertragen
-               $apiInstance->setCoonfigArray($configArray);
-
-               // Return the instance
-               return $apiInstance;
-       }
-
-       /**
-        * Setter for gamer data
-        *
-        * @param       $w_id   Username (id) of the gamer
-        * @param       $w_pwd  Clear password of the gamer
-        * @return      void
-        */
-       public function setUser (int $w_id, string $w_pwd) {
-               // Set username (id)
-               $this->w_id = $w_id;
-
-               // Hash clear password and set it
-               $this->w_md5 = md5($w_pwd);
-       }
-
-       /************************************************
-        * The following methods are not yet rewritten! *
-        ************************************************/
-
-       public function einziehen (int $amount) {
-               // amount auf Gueltigkeit pruefen
-               if ($amount < $this->config['mineinsatz']) {
-                       $this->setStatusMessage('low_stakes', sprintf('Dein Einsatz muss mindestens %d Wernis betragen.', $this->config['mineinsatz']));
-                       return false;
-               }
-
-               // Abfrage senden
-               return $this->executeWithdraw($amount);
-       }
-
-       public function verschicken (int $amount) {
-               // amount auf Gueltigkeit pruefen
-               if ($amount < $this->config['mineinsatz']) {
-                       $this->setStatusMessage('low_stakes', sprintf('Dein Einsatz muss mindestens %d Wernis betragen.', $this->config['mineinsatz']));
-                       return false;
-               }
-
-               // Abfrage senden
-               return $this->executePayout($amount);
-       }
-
-       // Script abbrechen mit Zurueck-Buttom
-       public function ende () {
-               global $_CONFIG;
-               include 'templates/zurueck.html';
-               include 'templates/fuss.html';
-               exit();
-       }
-
-       // Fehlermeldung ausgeben und beenden
-       public function error () {
-               print "<div class=\"fehler\">Fehler im Spiel: ".$this->getErrorMessage()."<div><br />\n";
-               $this->ende();
-       }
-
-       // Sets a status message and code
-       public function setStatusMessage (string $msg, string $status) {
-               $this->statusArray['message'] = $msg;
-               $this->statusArray['status'] = $status;
-       }
-
-       // Get the status message
-       public function getErrorMessage () {
-               if (isset($this->statusArray['message'])) {
-                       // Use raw message
-                       return $this->statusArray['message'];
-               } else {
-                       // Fall-back to status
-                       return sprintf('Fehler-Code <u>%s</u> ist keiner Nachricht zugewiesen.', $this->getErrorCode());
-               }
-       }
-
-       // Get the status code
-       public function getErrorCode () {
-               if (isset($this->statusArray['status'])) {
-                       // Use raw message
-                       return $this->statusArray['status'];
-               } else {
-                       // Something bad happend
-                       return 'unknown';
-               }
-       }
-
-       // Sends out a request to the API and returns it's result
-       private function sendRequest (string $scriptName, array $requestData = []) {
-               // Is the requestData an array?
-               if (!is_array($requestData)) {
-                       // Then abort here!
-                       return array(
-                               'status'  => 'failed_general',
-                               'message' => 'API-Daten in <strong>config</strong> sind ung&uuml;ltig!'
-                       );
-               }
-
-               // Is the API id and MD5 hash there?
-               if ((empty($this->config['wernis_api_id'])) || (empty($this->config['wernis_api_key']))) {
-                       // Abort here...
-                       return array(
-                               'status'  => 'failed_general',
-                               'message' => 'API-Daten in config.php sind leer!'
-                       );
-               }
-
-               // Construct the request string
-               $requestString = $this->config['api_url'] . $scriptName . '?api_id=' . $this->config['wernis_api_id'] . '&api_key='.$this->config['wernis_api_key'];
-               foreach ($requestData as $key => $value) {
-                       $requestString .= '&' . $key . '=' . $value;
-               }
-
-               // Get the raw response from the lower function
-               $response = $this->sendRawRequest($requestString);
-
-               // Check the response header if all is fine
-               if (strpos($response[0], '200') === false) {
-                       // Something bad happend... :(
-                       return array(
-                               'status'  => 'request_error',
-                               'message' => sprintf('Servermeldung <u>%s</u> von WDS66-API erhalten.', $response[0])
-                       );
-               }
-
-               // All (maybe) fine so remove the response header from server
-               for ($idx = (count($response) - 1); $idx > 1; $idx--) {
-                       $line = trim($response[$idx]);
-                       if (!empty($line)) {
-                               $response = $line;
-                               break;
-                       }
-               }
-
-               // Prepare the returning result for higher functions
-               if (substr($response, 0, 1) == '&') {
-                       // Remove the leading & (which can be used in Flash)
-                       $response = substr($response, 1);
-               }
-
-               // Bring back the response
-               $data = explode('=', $response);
-
-               // Default return array (should not stay empty)
-               $return = array();
-
-               // We use only the first two entries (which shall be fine)
-               if ($data[0] === 'error') {
-                       // The request has failed... :(
-                       switch ($data[1]) {
-                               case '404': // Invalid API ID
-                               case 'AUTH': // Authorization has failed
-                                       $return = array(
-                                               'status'  => 'auth_failed',
-                                               'message' => 'API-Daten scheinen nicht zu stimmen! (Access Denied)'
-                                       );
-                                       break;
-
-                               case 'LOCKED': // User account is locked!
-                               case 'PASS':   // Bad passphrase entered
-                               case 'USER':   // Missing account or invalid password
-                                       $return = array(
-                                               'status'  => 'user_failed',
-                                               'message' => 'Dein eingegebener WDS66-Username stimmt nicht, ist gesperrt oder du hast ein falsches Passwort eingegeben.'
-                                       );
-                                       break;
-
-                               case 'OWN': // Transfer to own account
-                                       $return = array(
-                                               'status'  => 'own_failed',
-                                               'message' => 'Du darfst dein eigenes Spiel leider nicht spielen.'
-                                       );
-                                       break;
-
-                               case 'AMOUNT': // Amount is depleted
-                                       $return = array(
-                                               'status'  => 'amount_failed',
-                                               'message' => 'Dein Guthaben reicht nicht aus, um das Spiel zu spielen.'
-                                       );
-                                       break;
-
-                               case 'AMOUNT-SEND': // API amount is depleted
-                                       $return = array(
-                                               'status'  => 'api_amount_failed',
-                                               'message' => 'Nicht gen&uuml;gend Guthaben auf dem API-Account.'
-                                       );
-                                       break;
-
-                               default: // Unknown error (maybe new?)
-                                       $return = array(
-                                               'status'  => 'request_failed',
-                                               'message' => sprintf('Unbekannter Fehler <u>%s</u> von API erhalten.', $data[1])
-                                       );
-                                       break;
-                       }
-               } else {
-                       // All fine here
-                       $return = array(
-                               'status'   => $this->statusOkay,
-                               'response' => $response
-                       );
-               }
-
-               // Return the result
-               return $return;
-       }
-
-       // Widthdraw this amount
-       private function executeWithdraw (int $amount) {
-               // First all fails...
-               $result = false;
-
-               // Prepare the purpose
-               $purpose = "\"Bube oder Dame\"-Einsatz gesetzt.";
-
-               // Prepare the request data
-               $requestData = array(
-                       'sub_request'   => 'receive',
-                       't_uid'                 => $this->w_id,
-                       't_md5'                 => $this->w_md5,
-                       'r_uid'                 => (int) $this->config['wernis_refid'],
-                       'amount'                => (int) $amount,
-                       'purpose'               => urlencode(base64_encode($purpose))
-               );
-
-               // Return the result from the lower functions
-               $return = $this->sendRequest('book.php', $requestData);
-
-               if ($return['status'] == $this->statusOkay) {
-                       // All fine!
-                       $result = true;
-               } else {
-                       // Status failture text
-                       $this->setStatusMessage($return['message'], $return['status']);
-               }
-
-               // Return result
-               return $result;
-       }
-
-       // Payout this amount
-       private function executePayout (int $amount) {
-               // First all fails...
-               $result = false;
-
-               // Prepare the purpose
-               $purpose = "\"Bube oder Dame\"-Gewinn erhalten.";
-
-               // Prepare the request data
-               $requestData = array(
-                       'sub_request'   => 'send',
-                       't_uid'                 => $this->w_id,
-                       't_md5'                 => $this->w_md5,
-                       'r_uid'                 => (int) $this->config['wernis_refid'],
-                       'amount'                => (int) $amount,
-                       'purpose'               => urlencode(base64_encode($purpose))
-               );
-
-               // Return the result from the lower functions
-               $return = $this->sendRequest("book.php", $requestData);
-
-               if ($return['status'] == $this->statusOkay) {
-                       // All fine!
-                       $result = true;
-               } else {
-                       // Status failture text
-                       $this->setStatusMessage($return['message'], $return['status']);
-               }
-
-               // Return result
-               return $result;
-       }
-
-       // Send raw GET request
-       private function sendRawRequest (string $script) {
-               // Use the hostname from script URL as new hostname
-               $url = substr($script, 7);
-               $extract = explode('/', $url);
-
-               // Done extracting the URL :)
-               $url = $extract[0];
-
-               // Extract host name
-               $host = str_replace('http://', '', $url);
-               if (ereg('/', $host)) $host = substr($host, 0, strpos($host, '/'));
-
-               // Generate relative URL
-               $script = substr($script, (strlen($url) + 7));
-               if (substr($script, 0, 1) == '/') $script = substr($script, 1);
-
-               // Open connection
-               $fp = @fsockopen($host, 80, $errno, $errdesc, 30);
-               if (!$fp) {
-                       // Failed!
-                       return array('', '', '');
-               }
-
-               // Generate request header
-               $request  = "GET /" . trim($script) . " HTTP/1.0\r\n";
-               $request .= "Host: " . $host . "\r\n";
-               $request .= sprintf("User-Agent: WernisApi/1.0 by Quix0r [Spieler: %d]\r\n\r\n", $this->w_id);
-
-               // Initialize array
-               $response = array();
-
-               // Write request
-               fputs($fp, $request);
-
-               // Read response
-               while(!feof($fp)) {
-                       array_push($response, trim(fgets($fp, 1024)));
-               } // END - while
-
-               // Close socket
-               fclose($fp);
-
-               // Was the request successfull?
-               if ((!ereg('200 OK', $response[0])) && (empty($response[0]))) {
-                       // Not found / access forbidden
-                       $response = array('', '', '');
-               } // END - if
-
-               // Return response
-               return $response;
-       }
-
-}
+// @DEPRECATED
index 46f5db5e3db33873e9aabba507ef3140aeb84367..c5ee29a3c69b0240996ef5c6b4f8f0f01b4c847d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -8,6 +8,7 @@ use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Localization\LanguageSystem;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Localization\LanguageSystem;
+use Org\Mxchange\CoreFramework\Localization\ManageableLanguage;
 use Org\Mxchange\CoreFramework\Loader\ClassLoader;
 use Org\Mxchange\CoreFramework\Generic\FrameworkException;
 
 use Org\Mxchange\CoreFramework\Loader\ClassLoader;
 use Org\Mxchange\CoreFramework\Generic\FrameworkException;
 
@@ -83,7 +84,7 @@ final class ApplicationEntryPoint {
                }
 
                // Get some instances
                }
 
                // Get some instances
-               $tpl = $configInstance->getConfigEntry('html_template_class');
+               $templateClassName = $configInstance->getConfigEntry('html_template_class');
                $languageInstance = LanguageSystem::getSelfInstance();
 
                // Initialize template instance here to avoid warnings in IDE
                $languageInstance = LanguageSystem::getSelfInstance();
 
                // Initialize template instance here to avoid warnings in IDE
@@ -93,11 +94,11 @@ final class ApplicationEntryPoint {
                $responseInstance = FrameworkBootstrap::getResponseInstance();
 
                // Is the template engine loaded?
                $responseInstance = FrameworkBootstrap::getResponseInstance();
 
                // Is the template engine loaded?
-               if ((class_exists($tpl)) && (is_object($languageInstance))) {
+               if ((class_exists($templateClassName)) && ($languageInstance instanceof ManageableLanguage)) {
                        // Use the template engine for putting out (nicer look) the message
                        try {
                                // Get the template instance from our object factory
                        // Use the template engine for putting out (nicer look) the message
                        try {
                                // Get the template instance from our object factory
-                               $templateInstance = ObjectFactory::createObjectByName($tpl);
+                               $templateInstance = ObjectFactory::createObjectByName($templateClassName);
                        } catch (FrameworkException $e) {
                                exit(sprintf('[Main:] Could not initialize template engine for reason: <span class="exception_reason">%s</span>',
                                        $e->getMessage()
                        } catch (FrameworkException $e) {
                                exit(sprintf('[Main:] Could not initialize template engine for reason: <span class="exception_reason">%s</span>',
                                        $e->getMessage()