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.

eZ debug

Timing: Jan 19 2025 03:28:49
Script start
Timing: Jan 19 2025 03:28:49
Module start 'layout'
Timing: Jan 19 2025 03:28:49
Module start 'content'
Timing: Jan 19 2025 03:28:50
Module end 'content'
Timing: Jan 19 2025 03:28:50
Script end

Main resources:

Total runtime0.8583 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 590.4219152.6406
Module start 'layout' 0.00760.0027 743.062539.4766
Module start 'content' 0.01030.8453 782.5391543.2969
Module end 'content' 0.85560.0027 1,325.835912.4375
Script end 0.8583  1,338.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.5146160.0003
Check MTime0.00130.1548160.0001
Mysql Total
Database connection0.00080.089810.0008
Mysqli_queries0.803093.5574570.0141
Looping result0.00060.0656550.0000
Template Total0.821395.720.4106
Template load0.00210.249020.0011
Template processing0.819195.433820.4096
Template load and register function0.00010.011010.0001
states
state_id_array0.00190.224510.0019
state_identifier_array0.00120.139820.0006
Override
Cache load0.00180.2064210.0001
Sytem overhead
Fetch class attribute can translate value0.00080.094220.0004
Fetch class attribute name0.00170.192950.0003
XML
Image XML parsing0.00100.117020.0005
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00100.1128230.0000
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs