From: Roland Häder Date: Fri, 1 May 2009 20:08:55 +0000 (+0000) Subject: Generic index.php updated from hub project X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=381a43b880c0dc68f62bff37742c3f965ec37f4f;p=install.git Generic index.php updated from hub project --- diff --git a/.gitattributes b/.gitattributes index c385d67..960cc50 100644 --- a/.gitattributes +++ b/.gitattributes @@ -48,7 +48,7 @@ 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.xml -text -application/install/templates/images/de/image/code_captcha.xml -text +application/install/templates/images/de/image/code_captcha.img -text /clear-cache.sh -text db/.htaccess -text docs/COPYING -text diff --git a/application/install/templates/images/de/image/code_captcha.img b/application/install/templates/images/de/image/code_captcha.img new file mode 100644 index 0000000..2e28522 --- /dev/null +++ b/application/install/templates/images/de/image/code_captcha.img @@ -0,0 +1,78 @@ +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 deleted file mode 100644 index 2e28522..0000000 --- a/application/install/templates/images/de/image/code_captcha.xml +++ /dev/null @@ -1,78 +0,0 @@ -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/index.php b/index.php index 3945af9..0050046 100644 --- 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 */