]> git.mxchange.org Git - install.git/commitdiff
Renamed to match with latest core
authorRoland Häder <roland@mxchange.org>
Sun, 5 Apr 2009 07:45:09 +0000 (07:45 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 5 Apr 2009 07:45:09 +0000 (07:45 +0000)
.gitattributes
application/install/templates/images/de/image/base_code.itp [deleted file]
application/install/templates/images/de/image/base_code.xml [new file with mode: 0644]
application/install/templates/images/de/image/code_captcha.itp [deleted file]
application/install/templates/images/de/image/code_captcha.xml [new file with mode: 0644]
index.php

index 798f8c8a6b63c83152806f43eef8666756245b1b..c385d6759ea40bb989e483a4c2deeebb2358753b 100644 (file)
@@ -47,8 +47,8 @@ application/install/templates/images/.htaccess -text
 application/install/templates/images/_cache/.htaccess -text
 application/install/templates/images/de/.htaccess -text
 application/install/templates/images/de/image/.htaccess -text
-application/install/templates/images/de/image/base_code.itp -text
-application/install/templates/images/de/image/code_captcha.itp -text
+application/install/templates/images/de/image/base_code.xml -text
+application/install/templates/images/de/image/code_captcha.xml -text
 /clear-cache.sh -text
 db/.htaccess -text
 docs/COPYING -text
diff --git a/application/install/templates/images/de/image/base_code.itp b/application/install/templates/images/de/image/base_code.itp
deleted file mode 100644 (file)
index 6501b56..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<image>
-       <type value="{?image_type?}" />
-       <base>
-               <name value="{?image_name?}" />
-       </base>
-       <resolution>
-               <width value="{?image_width?}" />
-               <height value="{?image_height?}" />
-       </resolution>
-       <background-color>
-               <red value="{?image_bg_red?}" />
-               <green value="{?image_bg_green?}" />
-               <blue value="{?image_bg_blue?}" />
-       </background-color>
-       <foreground-color>
-               <red value="{?image_fg_red?}" />
-               <green value="{?image_fg_green?}" />
-               <blue value="{?image_fg_blue?}" />
-       </foreground-color>
-       <image-string value="groupable">
-               <string-name value="{?image_string_name?}" />
-               <x value="{?image_x?}" />
-               <y value="{?image_y?}" />
-               <font-size value="{?image_size?}" />
-               <text value="{?image_string?}" />
-       </image-string>
-</image>
diff --git a/application/install/templates/images/de/image/base_code.xml b/application/install/templates/images/de/image/base_code.xml
new file mode 100644 (file)
index 0000000..6501b56
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<image>
+       <type value="{?image_type?}" />
+       <base>
+               <name value="{?image_name?}" />
+       </base>
+       <resolution>
+               <width value="{?image_width?}" />
+               <height value="{?image_height?}" />
+       </resolution>
+       <background-color>
+               <red value="{?image_bg_red?}" />
+               <green value="{?image_bg_green?}" />
+               <blue value="{?image_bg_blue?}" />
+       </background-color>
+       <foreground-color>
+               <red value="{?image_fg_red?}" />
+               <green value="{?image_fg_green?}" />
+               <blue value="{?image_fg_blue?}" />
+       </foreground-color>
+       <image-string value="groupable">
+               <string-name value="{?image_string_name?}" />
+               <x value="{?image_x?}" />
+               <y value="{?image_y?}" />
+               <font-size value="{?image_size?}" />
+               <text value="{?image_string?}" />
+       </image-string>
+</image>
diff --git a/application/install/templates/images/de/image/code_captcha.itp b/application/install/templates/images/de/image/code_captcha.itp
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]
-?>
diff --git a/application/install/templates/images/de/image/code_captcha.xml b/application/install/templates/images/de/image/code_captcha.xml
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]
+?>
index ec9080300da8eefcb9fe4549224ff9e68c907cad..3945af962076cc247ed0e9b1ab2e30f6a3c3e30d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -29,7 +29,12 @@ define('DEVELOPER', true);
  * 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 ApplicationEntryPoint {
+final class ApplicationEntryPoint {
+       /**
+        * Core path
+        */
+       private static $corePath = '';
+
        /**
         * The instances we want to remove after all is done
         *
@@ -155,6 +160,22 @@ class ApplicationEntryPoint {
                }
        }
 
+       /**
+        * Determines the correct absolute path for all include
+        *
+        * @return      $basePath       Base path (core) for all includes
+        */
+       protected static function detectCorePath () {
+               // Is it not set?
+               if (empty(self::$corePath)) {
+                       // Auto-detect our core path
+                       self::$corePath = str_replace("\\", '/', dirname(__FILE__));
+               } // END - if
+
+               // Return it
+               return self::$corePath;
+       }
+
        /**
         * The application's main entry point. This class isolates some local
         * variables which shall not become visible to outside because of security
@@ -165,7 +186,7 @@ class ApplicationEntryPoint {
         */
        public static function main () {
                // Load config file
-               require(dirname(__FILE__) . '/inc/config.php');
+               require(self::detectCorePath() . '/inc/config.php');
 
                // Load all include files
                require($cfg->readConfig('base_path') . 'inc/includes.php');