[TYPO3-mvc] Where / how to store extension related data?

Henjo Hoeksma me at henjohoeksma.nl
Thu Feb 16 00:38:30 CET 2012


You could also create a configuration object in your model... In that case
you still work pretty clean, though it might not be the right way of Domain
Modeling.

I did some of what you want to achieve on the plugin side. With a fallback
to TS.

Kind regards,

Henjo

Problems are small because we learned how to deal with them.
Problems are big because we need to learn how to deal with them.


On Wed, Feb 15, 2012 at 16:49, Stig Nørgaard Færch <snf at dkm.dk> wrote:

> Den 15-02-2012 16:25, Xavier Perseguers skrev:
>
>  Hi,
>>
>>  Check "image_autoresize" ext and see how Xavier made use of flexform to
>>>>> store user settings.
>>>>>
>>>>
>>>> OT: I like so much how I could hack the (old) EM to do that... :)
>>>>
>>>
>>> This is how I intend to do it:
>>>
>>> $key = '$TYPO3_CONF_VARS[\'EXT\'][\'**extConf\'][\'extName\']';
>>> $value = '\'' . serialize(array('someKey'=>'**someValue')) . '\'';
>>> $instObj = t3lib_div::makeInstance('**t3lib_install');
>>> $instObj->allowUpdateLocalConf = 1;
>>> $instObj->updateIdentity = 'EXT:extName';
>>> $lines = $instObj->writeToLocalconf_**control();
>>> $instObj->**setValueInLocalconfFile($**lines, $key, $value, FALSE);
>>> $result = $instObj->writeToLocalconf_**control($lines);
>>>
>>> Do you think this would be ok?
>>> I tried it, and it seemed to work alright.
>>>
>>
>> This really looks like what I used in the aforementioned extension and
>> as it works, then it's OK of course :)
>>
>
> No, it doesn't seem like you made use of it :-)
> You did try to use the tx_install class. I use t3lib_install instead.
> the tx_install class makes a redirect, which makes it impossible to use in
> a good way.
>
>    /**
>     * Writes a configuration line to localconf.php.
>     * We don't use the <code>tx_install</code> methods as they add unneeded
>     * comments at the end of the file.
>     *
>     * @param string $key
>     * @param string $value
>     * @return boolean
>     */
>    protected function writeToLocalconf($key, $value) {
>        //$instObj = t3lib_div::makeInstance('tx_**install');
>        //$instObj->**allowUpdateLocalConf = 1;
>        //$instObj->updateIdentity = 'TYPO3 Core Update Manager';
>        //$lines = $instObj->writeToLocalconf_**control();
>        //$instObj->**setValueInLocalconfFile($**lines, $key, $value,
> FALSE);
>        //$result = $instObj->writeToLocalconf_**control($lines);
>        //if ($result !== 'nochange') {
>        //    $this->config = $newConfig;
>        //    t3lib_extMgm::**removeCacheFiles();
>        //}
>        //$instObj = null;
>
> ______________________________**_________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc@**lists.typo3.org<TYPO3-project-typo3v4mvc at lists.typo3.org>
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-**
> project-typo3v4mvc<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc>
>


More information about the TYPO3-project-typo3v4mvc mailing list