Revision 99
Added by stefan about 20 years ago
| install.php | ||
|---|---|---|
| 1 | 1 |
<?php |
| 2 | 2 |
|
| 3 |
// $Id: install.php,v 1.5 2005/04/02 06:25:37 rdjurovich Exp $
|
|
| 3 |
// $Id$ |
|
| 4 | 4 |
|
| 5 | 5 |
/* |
| 6 | 6 |
|
| ... | ... | |
| 68 | 68 |
unset($language_code); |
| 69 | 69 |
|
| 70 | 70 |
// Read the temp file and look for a language code |
| 71 |
$file_contents = file_get_contents($temp_file); |
|
| 72 |
$search_for_code = strstr($file_contents, '$language_code'); |
|
| 73 |
if($search_for_code != '') {
|
|
| 74 |
if(strstr($search_for_code, "'")) {
|
|
| 75 |
$search_for_code2 = strstr($search_for_code, "'"); |
|
| 76 |
} else {
|
|
| 77 |
$search_for_code2 = strstr($search_for_code, '"'); |
|
| 78 |
} |
|
| 79 |
$language_code = substr($search_for_code2, 1, 2); |
|
| 80 |
} |
|
| 71 |
require($temp_file); |
|
| 72 |
$new_language_version=$language_version; |
|
| 81 | 73 |
|
| 82 | 74 |
// Check if the file is valid |
| 83 | 75 |
if(!isset($language_code)) {
|
| ... | ... | |
| 91 | 83 |
$language_file = WB_PATH.'/languages/'.$language_code.'.php'; |
| 92 | 84 |
|
| 93 | 85 |
// Move to new location |
| 86 |
if (file_exists($language_file)) {
|
|
| 87 |
require($language_file); |
|
| 88 |
if ($language_version>$new_language_version) {
|
|
| 89 |
$admin->print_error($MESSAGE['GENERIC']['ALREADY_INSTALLED']); |
|
| 90 |
} |
|
| 91 |
unlink($language_file); |
|
| 92 |
} |
|
| 93 |
|
|
| 94 | 94 |
rename($temp_file, $language_file); |
| 95 | 95 |
|
| 96 | 96 |
// Chmod the file |
Also available in: Unified diff
Implemented upgrade functionality in templates and languages. Fixed some bugs.