Jump to content


Photo

How does INI section inheritance work?


  • Please log in to reply
2 replies to this topic

#1 yoursurrogategod

yoursurrogategod

    Advanced Member

  • Members
  • PipPipPip
  • 179 posts

Posted 15 February 2013 - 12:09 PM

I googled this, but couldn't find anything specific.

Basically, if I have this file:
[production]
val1 = 'hello'

[staging : production]
val2 = 'world'

[development : staging]
val1 = 'g day'

When the file is read, when the parser gets to staging, it inherits val1 as 'hello' from production, but in development, it's set to 'g day', yes? And val2 remains as 'world' throughout, right? You can do such nested inheritance.

#2 Jessica

Jessica

    This is not my name.

  • Gurus
  • 8,982 posts
  • LocationDallas, TX
  • Age:26

Posted 15 February 2013 - 12:10 PM

Honestly, this is a topic I know nothing about, but did you TRY IT? It cannot possibly hurt to try.
My goal in replying to posts is to help you become a better programmer, including learning how to debug your own code and research problems. For that reason, rather than posting the solution, I reply with tips and hints on how to find the solution yourself. See below for useful links when you get stuck.

How to Get Good Help: How to Ask Questions | Don't be a help vampire
Debugging Your Code: Debugging your SQL | What does a php function do? | What does a term mean? | Don't see any errors?
Things You Should Do: Normalize Your Data | use print_r() or var_dump()
Lulz: "Functions should not have side effects." - trq

Please take a look at my new PHP/Web Dev blog: The Web Mason - Thanks!!

#3 yoursurrogategod

yoursurrogategod

    Advanced Member

  • Members
  • PipPipPip
  • 179 posts

Posted 15 February 2013 - 12:34 PM

I should have mentioned that I'm working in Zend Framework 1.12.

But basically, what I described is what happens. This is a problem if you're using arrays and you're in a different section. The original array gets over-written and you lose the previous information. Gotta watch out for that.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com