On 3 April 2011 21:38, Peter Lind <peter.e.l...@gmail.com> wrote:
> On 3 April 2011 22:35, Andre Polykanine <an...@oire.org> wrote:
>> Hello Peter,
>>
>> Thanks a lot! And is there a way to set (write) custom values in files
>> other than php.ini? Sorry, didn't find such a function.
>>
>
> I haven't come across any, but then again, I haven't had the need so
> never looked much ... It would be rather easy to generate though
>
> Regards
> Peter
>
> --
> <hype>
> WWW: plphp.dk / plind.dk
> LinkedIn: plind
> BeWelcome/Couchsurfing: Fake51
> Twitter: kafe15
> </hype>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

For a truly quick and dirty config, then just use PHP.

A similar mechanism is used by PhD - the PHP Documentation building tool.

<?php
// Create default config
$config = array('item1' => 'value1');

// Load the saved config.
$loadedConfig = include './config.inc';

// Merge configs.
$config = array_merge($config, $loadedConfig);

// Manipulate config.
$config['item1'] = 'value2';

// Save config.
file_put_contents('./config.inc', '<?php return ' .
var_export($config, true) .';');
?>



-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to