eZINI::instance how to force a siteaccess?

Author Message

Pascal Specht

Friday 08 August 2008 7:54:41 am

Hi there,

the following code works fine:

    $ini =& eZINI::instance( "colors.ini" );
    $blue = (int) $ini->variable('ColorSettings','blue');

but it will automatically take the correct value from the current siteaccess ini file. Is there a way to force the site-access somehow, i.e. doing something like:

    // (wrong code!)
    $ini =& eZINI::instance( "colors.ini" , "fre" );
    $blue = (int) $ini->variable('ColorSettings','blue');

Thank you very much in advance,
</Pascal>

André R.

Friday 08 August 2008 8:48:31 am

It's possible, but way more complex then that.
It's not very clean at the moment and the api might change to the better in 4.1 ( #013382 ).

Take a look in kernel/content/versionview.php or kernel/settings/view.php (but do note that this code makes the change globally).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Pascal Specht

Friday 08 August 2008 9:09:29 am

Hi André,

ok, I see. Thanks! very helpful indeed.

</Pascal>

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.