📄 class.tx_install.php
字号:
'; switch(strtolower($this->step)) { case 1: $msg=' <br /> <br /> <table border="0"> <form action="'.$this->action.'" method="post"> <tr> <td valign="top" nowrap="nowrap"><strong> '.$this->fontTag2.'Username:</span></strong> </td> <td> </td> <td valign="top"> '.$this->fontTag2.' <input type="text" name="TYPO3_INSTALL[localconf.php][typo_db_username]" value="'.TYPO3_db_username.'"></span><br /> </td> </tr> <tr> <td valign="top" nowrap="nowrap"><strong> '.$this->fontTag2.'Password:</span></strong> </td> <td> </td> <td valign="top"> '.$this->fontTag2.' <input type="text" name="TYPO3_INSTALL[localconf.php][typo_db_password]" value="'.TYPO3_db_password.'"></span><br /> </td> </tr> <tr> <td valign="top" nowrap="nowrap"><strong> '.$this->fontTag2.'Host:</span></strong> </td> <td> </td> <td valign="top"> '.$this->fontTag2.' <input type="text" name="TYPO3_INSTALL[localconf.php][typo_db_host]" value="'.(TYPO3_db_host?TYPO3_db_host:'localhost').'"></span><br /> </td> </tr> <tr> <td valign="top" nowrap="nowrap"><strong> '.$this->fontTag1.'</span></strong> </td> <td> </td> <td valign="top"> '.$this->fontTag1.'<br /> <input type="hidden" name="step" value="2"> <input type="hidden" name="TYPO3_INSTALL[localconf.php][encryptionKey]" value="'.md5(uniqid(rand(),true)).'"> <input type="hidden" name="TYPO3_INSTALL[localconf.php][compat_version]" value="'.TYPO3_branch.'"> <input type="submit" value="Continue"><br /><br /><strong>NOTICE: </strong>By clicking this button, typo3conf/localconf.php is updated with new values for the parameters listed above!</span><br /> </td> </tr> </form> </table> <br /> <br />'; break; case 2: if ($result = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) { $dbArr = $this->getDatabaseList(); reset($dbArr); $options=''; $options.='<option value="">[ SELECT DATABASE ]</option>'; $dbIncluded=0; while(list(,$dbname)=each($dbArr)) { $options.='<option value="'.htmlspecialchars($dbname).'"'.($dbname==TYPO3_db?' selected="selected"':'').'>'.htmlspecialchars($dbname).'</option>'; if ($dbname==TYPO3_db) $dbIncluded=1; } if (!$dbIncluded && TYPO3_db) { $options.='<option value="'.htmlspecialchars(TYPO3_db).'" selected="selected">'.htmlspecialchars(TYPO3_db).' (NO ACCESS!)</option>'; } $select='<select name="TYPO3_INSTALL[localconf.php][typo_db]">'.$options.'</select>'; $msg='<br /><br /> <table border="0"> <form action="'.$this->action.'" method="post"> <tr> <td valign="top" nowrap="nowrap"><strong> '.$this->fontTag2.' You have two options:<br /> <br /><br /> 1: Select an existing <u>EMPTY</u> database:</span></strong> </td> </tr> <tr> <td valign="top"> '.$this->fontTag1.'Any existing tables which are used by TYPO3 will be overwritten in Step 3. So make sure this database is empty:<br />'.$select.'</span><br /> </td> </tr> <tr> <td valign="top" nowrap="nowrap"><br /> <br /><strong> '.$this->fontTag2.'2: Create new database (recommended):</span></strong> </td> </tr> <tr> <td valign="top"> '.$this->fontTag1.'Enter the desired name of the database here:<br /><input type="text" name="TYPO3_INSTALL[localconf.php][NEW_DATABASE_NAME]" value=""></span><br /> </td> </tr> <tr> <td valign="top"> <br /> '.$this->fontTag1.'<br /> <input type="hidden" name="step" value="3"> <input type="submit" value="Continue"><br /><br /><strong>NOTICE: </strong>By clicking this button, typo3conf/localconf.php is updated with new values for the parameters listed above!</span><br /> </td> </tr> </form> </table><br /><br /> '; } else { $msg=$error_missingConnect; } break; case 3: if ($result = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) { if ($GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db)) { $sFiles = t3lib_div::getFilesInDir(PATH_typo3conf,'sql',1,1); // Check if default database scheme "database.sql" already exists, otherwise create it if (!strstr(implode(',',$sFiles).',', '/database.sql,')) { array_unshift($sFiles,'Create default database tables'); } $opt=''; foreach ($sFiles as $f) { if ($f=='Create default database tables') $key='CURRENT_TABLES+STATIC'; else $key=htmlspecialchars($f); $opt.='<option value="import|'.$key.'">'.htmlspecialchars(basename($f)).'</option>'; } $content=' '.$this->fontTag2.'Please select a database dump:</span><br /> <input type="hidden" name="TYPO3_INSTALL[database_import_all]" value=1> <input type="hidden" name="step" value=""> <input type="hidden" name="goto_step" value="go"> <select name="TYPO3_INSTALL[database_type]">'.$opt.'</select><br />'; $content = $this->getUpdateDbFormWrap('import', $content, 'Import database'); $msg=' <br /> '.$dbInfo.'<br /> <br /> '.$content.' '; } else { $msg=$error_missingDB; } } else { $msg=$error_missingConnect; } break; case 'go': if ($result = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) { if ($GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db)) { if (count($whichTables)) { $msg=' <br /> '.$this->fontTag2.' '.nl2br($this->messageBasicFinished()).' <br /> <hr /> <div align="center"><strong><img src="'.$this->backPath.'gfx/icon_warning.gif" hspace="5" width="18" height="16" class="absmiddle">IMPORTANT</strong></div><br /> <span class="smalltext">'.nl2br($this->securityRisk()).' <br /> <strong>Enter <a href="'.$this->scriptSelf.'">"Normal" mode for the Install Tool</a> to change this!</strong><br /> </span> </span><br /> '; } else { $msg=$error_emptyDB; } } else { $msg=$error_missingDB; } } else { $msg=$error_missingConnect; } break; } return $msg; } /** * Calling the functions that checks the system * * @return [type] ... */ function checkTheConfig() { // Order important: $this->checkDirs(); $this->checkConfiguration(); $this->checkExtensions(); if (TYPO3_OS=='WIN') { $paths=array($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'], $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'], 'c:\\php\\imagemagick\\', 'c:\\apache\\ImageMagick\\'); } else { $paths=array($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'], $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'], '/usr/local/bin/','/usr/bin/','/usr/X11R6/bin/'); } asort($paths); if (ini_get('safe_mode')) { $paths=array(ini_get('safe_mode_exec_dir'),'/usr/local/php/bin/'); } if ($this->INSTALL['checkIM']['lzw']) { $this->checkIMlzw=1; } if ($this->INSTALL['checkIM']['path']) { $paths[]=trim($this->INSTALL['checkIM']['path']); } if ($this->checkIM) $this->checkImageMagick($paths); $this->checkDatabase(); } /** * Editing files in typo3conf directory (or elsewhere if enabled) * * @return [type] ... */ function typo3conf_edit() { $EDIT_path = PATH_typo3conf; // default: if ($this->allowFileEditOutsite_typo3conf_dir && $this->INSTALL['FILE']['EDIT_path']) { if (t3lib_div::validPathStr($this->INSTALL['FILE']['EDIT_path']) && substr($this->INSTALL['FILE']['EDIT_path'],-1)=='/') { $tmp_path = PATH_site.$this->INSTALL['FILE']['EDIT_path']; if (is_dir($tmp_path)) { $EDIT_path=$tmp_path; } else {debug("'".$tmp_path."' was not dir");} } else { debug('BAD DIR_NAME (must be like t3lib/ or media/script/)'); } } $headCode = 'Edit files in '.basename($EDIT_path).'/'; $this->contentBeforeTable=''; if ($this->INSTALL['SAVE_FILE']) { $save_to_file = $this->INSTALL['FILE']['name']; if (@is_file($save_to_file)) { $save_to_file_md5 = md5($save_to_file); if (isset($this->INSTALL['FILE'][$save_to_file_md5]) && t3lib_div::isFirstPartOfStr($save_to_file,$EDIT_path.'') && substr($save_to_file,-1)!='~' && !strstr($save_to_file,'_bak')) { $this->INSTALL['typo3conf_files'] = $save_to_file; $save_fileContent = $this->INSTALL['FILE'][$save_to_file_md5]; if ($this->INSTALL['FILE']['win_to_unix_br']) { $save_fileContent = str_replace(chr(13).chr(10),chr(10),$save_fileContent); } $backupFile = $this->getBackupFilename($save_to_file); if ($this->INSTALL['FILE']['backup']) { if (@is_file($backupFile)) { unlink($backupFile); } rename($save_to_file,$backupFile); $this->contentBeforeTable.='Backup written to <strong>'.$backupFile.'</strong><br />'; } t3lib_div::writeFile($save_to_file,$save_fileContent); $this->contentBeforeTable.=' File saved: <strong>'.$save_to_file.'</strong><br /> MD5-sum: '.$this->INSTALL['FILE']['prevMD5'].' (prev)<br /> MD5-sum: '.md5($save_fileContent).' (new)<br /> '; } } } // Filelist: $typo3conf_files = t3lib_div::getFilesInDir($EDIT_path,'',1,1); reset($typo3conf_files); $lines=array(); $fileFound = 0; while(list($k,$file)=each($typo3conf_files)) { // Delete temp_CACHED files if option is set if ( $this->INSTALL['delTempCached'] && preg_match('|/temp_CACHED_[a-z0-9_]+\.php|', $file)) { unlink($file); continue; } if ($this->INSTALL['typo3conf_files'] && !strcmp($this->INSTALL['typo3conf_files'],$file)) { $wrap=array('<strong><span style="color:navy;">','</span></strong>'); $fileFound = 1; } else {$wrap=array();} $lines[]='<tr><td nowrap="nowrap"><a href="'.$this->action.'&TYPO3_INSTALL[typo3conf_files]='.rawurlencode($file).($this->allowFileEditOutsite_typo3conf_dir?'&TYPO3_INSTALL[FILE][EDIT_path]='.rawurlencode($this->INSTALL['FILE']['EDIT_path']):"").'">'.$this->fw($wrap[0].basename($file).$wrap[1].' ').'</a></td><td>'.$this->fw(t3lib_div::formatSize(filesize($file))).'</td></tr>'; } $fileList='<table border="0" cellpadding="0" cellspacing="0">'.implode('',$lines).'</table>'; $fileList.='<br />('.$EDIT_path.')'; if ($this->allowFileEditOutsite_typo3conf_dir) { $fileList.='<br /><form action="'.$this->action.'" method="post"> '.PATH_site.'<input type="text" name="TYPO3_INSTALL[FILE][EDIT_path]" value="'.$this->INSTALL['FILE']['EDIT_path'].'"><input type="submit" name="" value="Set"> </form>'; } // create link for deleting temp_CACHED files $fileList .= '<br /><br /><a href="'.$this->action.'&TYPO3_INSTALL[delTempCached]=1">Delete temp_CACHED* files</a>'; if ($fileFound && @is_file($this->INSTALL['typo3conf_files'])) { $this->headerStyle = ' <style type="text/css"><!-- SELECT {font-family: Verdana,Arial,Helvetica,Sans-serif; font-size: 10px;} TEXTAREA {font-family: Verdana,Arial,Helvetica,Sans-serif; font-size: 10px;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -