]> git.mxchange.org Git - admin.git/commitdiff
Generic index.php updated from hub project
authorRoland Häder <roland@mxchange.org>
Fri, 1 May 2009 20:08:29 +0000 (20:08 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 1 May 2009 20:08:29 +0000 (20:08 +0000)
.gitattributes
application/admin/templates/images/de/image/code_captcha.img [new file with mode: 0644]
application/admin/templates/images/de/image/code_captcha.xml [deleted file]
index.php

index 6174d474bc602c37c4076096c4a8cef822159536..ac800f01ed6f860dfc020755d99456aa682ba2e8 100644 (file)
@@ -56,7 +56,7 @@ application/admin/templates/images/_cache/.htaccess -text
 application/admin/templates/images/de/.htaccess -text
 application/admin/templates/images/de/image/.htaccess -text
 application/admin/templates/images/de/image/base_code.xml -text
-application/admin/templates/images/de/image/code_captcha.xml -text
+application/admin/templates/images/de/image/code_captcha.img -text
 /clear-cache.sh -text
 db/.htaccess -text
 db/company/.htaccess -text
diff --git a/application/admin/templates/images/de/image/code_captcha.img b/application/admin/templates/images/de/image/code_captcha.img
new file mode 100644 (file)
index 0000000..2e28522
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+// Needed in every image template to initialy set the image type
+$helper = ImageHelper::createImageHelper($this, "png");
+$helper->setImageName("code_captcha");
+$helper->setBaseImage("base_code");
+
+// Set image dimensions
+$helper->setWidth(100);
+$helper->setHeight(50);
+
+// Get random number
+$rand = $helper->getRngInstance()->randomNumber(0, 6);
+
+// Background and foreground color
+switch ($rand) {
+       case 1:
+               // First varriant
+               $helper->setBackgroundColorRedGreenBlue('rand', 0x90  , 0x00  );
+               $helper->setForegroundColorRedGreenBlue(0x00  , 0xff  , 'rand');
+               break;
+
+       case 2:
+               // Second varriant
+               $helper->setBackgroundColorRedGreenBlue(0x90  , 'rand', 0x00  );
+               $helper->setForegroundColorRedGreenBlue(0xff  , 0x00  , 'rand');
+               break;
+
+       case 3:
+               // Third varriant
+               $helper->setBackgroundColorRedGreenBlue('rand', 0x00  , 0x90  );
+               $helper->setForegroundColorRedGreenBlue(0x00  , 'rand', 0xff  );
+               break;
+
+       case 4:
+               // Forth varriant
+               $helper->setBackgroundColorRedGreenBlue(0x00  , 0x90  , 'rand');
+               $helper->setForegroundColorRedGreenBlue(0x00  , 'rand', 0xa0  );
+               break;
+
+       case 5:
+               // Fith varriant
+               $helper->setBackgroundColorRedGreenBlue('rand', 0x00  , 0x90  );
+               $helper->setForegroundColorRedGreenBlue(0x00  , 0xe0  , 'rand');
+               break;
+
+       default:
+               // Last varriant
+               $helper->setBackgroundColorRedGreenBlue(0x00  , 'rand', 0x90  );
+               $helper->setForegroundColorRedGreenBlue(0xff  , 0x00  , 'rand');
+               break;
+}
+
+// Random X/Y factors...
+$xRand = $helper->getRngInstance()->randomNumber(0, 45);
+$yRand = $helper->getRngInstance()->randomNumber(0, 25);
+
+// Add code
+$helper->addTextLine("code");
+$helper->setCoord((5 + $xRand), (5 + $yRand));
+$helper->setFontSize('rand');
+$helper->setImageString("{?decrypted_code?}");
+
+// Only for debug!
+/*
+$helper->addTextLine("debug");
+$helper->setCoord(90, 35);
+$helper->setFontSize(3);
+$helper->setImageString($rand);
+*/
+
+// Flush content to the template engine
+$helper->flushContent();
+
+// Comment this out if image is done
+//$this->debugInstance();
+
+// [EOF]
+?>
diff --git a/application/admin/templates/images/de/image/code_captcha.xml b/application/admin/templates/images/de/image/code_captcha.xml
deleted file mode 100644 (file)
index 2e28522..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-// Needed in every image template to initialy set the image type
-$helper = ImageHelper::createImageHelper($this, "png");
-$helper->setImageName("code_captcha");
-$helper->setBaseImage("base_code");
-
-// Set image dimensions
-$helper->setWidth(100);
-$helper->setHeight(50);
-
-// Get random number
-$rand = $helper->getRngInstance()->randomNumber(0, 6);
-
-// Background and foreground color
-switch ($rand) {
-       case 1:
-               // First varriant
-               $helper->setBackgroundColorRedGreenBlue('rand', 0x90  , 0x00  );
-               $helper->setForegroundColorRedGreenBlue(0x00  , 0xff  , 'rand');
-               break;
-
-       case 2:
-               // Second varriant
-               $helper->setBackgroundColorRedGreenBlue(0x90  , 'rand', 0x00  );
-               $helper->setForegroundColorRedGreenBlue(0xff  , 0x00  , 'rand');
-               break;
-
-       case 3:
-               // Third varriant
-               $helper->setBackgroundColorRedGreenBlue('rand', 0x00  , 0x90  );
-               $helper->setForegroundColorRedGreenBlue(0x00  , 'rand', 0xff  );
-               break;
-
-       case 4:
-               // Forth varriant
-               $helper->setBackgroundColorRedGreenBlue(0x00  , 0x90  , 'rand');
-               $helper->setForegroundColorRedGreenBlue(0x00  , 'rand', 0xa0  );
-               break;
-
-       case 5:
-               // Fith varriant
-               $helper->setBackgroundColorRedGreenBlue('rand', 0x00  , 0x90  );
-               $helper->setForegroundColorRedGreenBlue(0x00  , 0xe0  , 'rand');
-               break;
-
-       default:
-               // Last varriant
-               $helper->setBackgroundColorRedGreenBlue(0x00  , 'rand', 0x90  );
-               $helper->setForegroundColorRedGreenBlue(0xff  , 0x00  , 'rand');
-               break;
-}
-
-// Random X/Y factors...
-$xRand = $helper->getRngInstance()->randomNumber(0, 45);
-$yRand = $helper->getRngInstance()->randomNumber(0, 25);
-
-// Add code
-$helper->addTextLine("code");
-$helper->setCoord((5 + $xRand), (5 + $yRand));
-$helper->setFontSize('rand');
-$helper->setImageString("{?decrypted_code?}");
-
-// Only for debug!
-/*
-$helper->addTextLine("debug");
-$helper->setCoord(90, 35);
-$helper->setFontSize(3);
-$helper->setImageString($rand);
-*/
-
-// Flush content to the template engine
-$helper->flushContent();
-
-// Comment this out if image is done
-//$this->debugInstance();
-
-// [EOF]
-?>
index 3945af962076cc247ed0e9b1ab2e30f6a3c3e30d..005004646b5cee9d87e2ae89b499f8f675e6604d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -60,7 +60,7 @@ final class ApplicationEntryPoint {
         * @param       $silentMode             Wether not silent mode is turned on
         * @return      void
         */
-       public static function app_die ($message = "", $code = false, $extraData = "", $silentMode = false) {
+       public static function app_die ($message = '', $code = false, $extraData = '', $silentMode = false) {
                // Is this method already called?
                if (defined('EMERGENCY_EXIT_CALLED')) {
                        // Then output the text directly
@@ -73,14 +73,14 @@ final class ApplicationEntryPoint {
                // Is a message set?
                if (empty($message)) {
                        // No message provided
-                       $message = "No message provided!";
+                       $message = 'No message provided!';
                } // END - if
 
                // Get config instance
                $configInstance = FrameworkConfiguration::getInstance();
 
                // Do we have debug installation?
-               if (($configInstance->readConfig('product_install_mode') == "productive") || ($silentMode === true)) {
+               if (($configInstance->readConfig('product_install_mode') == 'productive') || ($silentMode === true)) {
                        // Abort here
                        die();
                } // END - if
@@ -106,7 +106,7 @@ final class ApplicationEntryPoint {
 
                        // Get and prepare backtrace for output
                        $backtraceArray = debug_backtrace();
-                       $backtrace = "";
+                       $backtrace = '';
                        foreach ($backtraceArray as $key => $trace) {
                                if (!isset($trace['file'])) $trace['file'] = __FILE__;
                                if (!isset($trace['line'])) $trace['line'] = __LINE__;
@@ -161,7 +161,8 @@ final class ApplicationEntryPoint {
        }
 
        /**
-        * Determines the correct absolute path for all include
+        * Determines the correct absolute path for all includes only once per run.
+        * Other calls of this method are being "cached".
         *
         * @return      $basePath       Base path (core) for all includes
         */