[TYPO3-core] RFC #16215: Allow array as localconf.php configuration values

Susanne Moog typo3 at susannemoog.de
Fri Nov 5 19:29:13 CET 2010


On 02.11.2010 11:38, Xavier Perseguers wrote:
> Hi,
> 
> This is an SVN patch request.
> 
> Type: feature
> 
> Bugtracker reference:
> http://bugs.typo3.org/view.php?id=16215
> 
> Branches: trunk
> 
> Problem:
> Currently t3lib_install lacks a way to store an array as configuration
> value.
> 
> Having this method in Core would allow DBAL to use native methods
> instead of writing localconf.php itself.
> 
> Further information:
> Latest version of patch (in DBAL)
> http://bugs.typo3.org/view.php?id=15755 uses this method
> 
> Further information #2:
> Once it gets committed, I'll make a small refactoring in DBAL when using
> 1-2-3 wizard to prevent such configuration line to be written (as it is
> currently):
> 
> $TYPO3_CONF_VARS['EXTCONF']['dbal']['handlerCfg'] = array('_DEFAULT' =>
> array('type' => 'adodb','config' => array('driver' =>
> 'oci8','driverOptions' => array('connectSID' => TRUE))));
> 
> To have this instead:
> 
> $TYPO3_CONF_VARS['EXTCONF']['dbal']['handlerCfg'] = array(
>     '_DEFAULT' => array(
>         'type' => 'adodb',
>         'config' => array(
>             'driver' => 'oci8',
>             'driverOptions' => array(
>                 'connectSID' => TRUE,
>             )
>         )
>     )
> );
> 
> How to test:
> See that EM still can properly change your localconf.php
I tested some things and found something buggy.

The install tool "all configuration" section has the neat possibility to
display even custom options configured in localconf.php
For example add:
$TYPO3_CONF_VARS['EXTCONF']['dbal'] = 'test';	

and you'll get a text input field.

If I now add additionally to that line
// Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['EXTCONF']['dbal']['handlerCfg'] = array(
    '_DEFAULT' => array(
        'type' => 'adodb',
        'config' => array(
            'driver' => 'oci8',
            'driverOptions' => array(
                'connectSID' => TRUE,
            )
        )
    )
);

there are two problems:
1) the array is not editable by the all configuration section (this
could be an extra bug/feature)
2) adding the array causes the install tool to change the first line to:
$TYPO3_CONF_VARS['EXTCONF']['dbal'] = 'Aest'; (changes the "t" to an
"A") in the install tool and saves the wrong value on enter - which is a
real bug I think.

Other than that really nice feature.

Susanne


-- 
What's worth the price is always worth the fight
Every second counts 'cause there's no second try

TYPO3 Core Team Member


More information about the TYPO3-team-core mailing list