TYPO3版本6.x-其他配置也称为`localconf_local.php` [英] TYPO3 ver. 6.x - additional configuration a.k.a. `localconf_local.php`

查看:89
本文介绍了TYPO3版本6.x-其他配置也称为`localconf_local.php`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在TYPO3版本中。 4.x我们以前通过在 localconf.php

In TYPO3 ver. 4.x we used to include additional configuration file for overwriting some settings (ie. DB credentials) by adding the include statement at the end of the localconf.php:

@include_once('localconf_local.php');

由于有了这一技巧,示例可能会为每个开发人员保留单独的数据库设置或IM路径因为我们可以忽略git存储库中的本地文件。

Thanks to this trick it is possible for an example keep separate database settings or IM paths individual for each developer as we can just ignore our 'local' files from the git repository.

不幸的是TYPO3版本6.x这种方法需要手动更改 LocalConfiguration.php 来覆盖 return 语句之前的值,而且在安装工具(或扩展管理器)中执行每次操作后,文件完全使用原始语法(因此我们需要一次又一次地对其进行更改...

Unfortunately in TYPO3 ver. 6.x that approach requires manual changes of the LocalConfiguration.php to overwrite the values before the return statement, what's more after each operation in Install Tool (or Extension Manager) the file is completely to original syntax (so we need to change it again and again...

你们对此有任何解决方法吗?或者这仅仅是...不可能做?

Have you guys any workaround for this? Or this is just... impossible to do?

推荐答案

知道了!:)

答案是: typo3conf / AdditionalConfiguration.php 文件存在,它会自动包含在内,要覆盖某些值,我们需要使用众所周知的语法,即:

The answer is: typo3conf/AdditionalConfiguration.php if this file exists it's included automatically, to overwrite some values we need to use well-known syntax ie.:

<?php
$GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = 'my_local_database';
$GLOBALS['TYPO3_CONF_VARS']['DB']['host']     = 'localhost';
$GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'username';
$GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'mypassword';
?>

来自新功能 SlideShare (第33页)

这篇关于TYPO3版本6.x-其他配置也称为`localconf_local.php`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆