# Best/Proper way to process an extension-specific configuration (ini) file.

- Thread: https://externals.io/message/43034
- Original archive: https://news-web.php.net/php.internals/43034
- Started by David M. Patterson on 2009-02-13T19:31:00+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #43034 — David M. Patterson — 2009-02-13T19:31:00+00:00

URL: https://externals.io/message/43034#43034

I am writing an extension that requires its own configuration file.

I would prefer to not re-invent the parse a config file wheel and so, have
been trying to use zend_parse_ini_file() function. Unfortunately, I have
been unable to make this work, so far.

If someone would either provide a code snippet for this or point me to one,
I'd really appreciate it.

 

Thanks,

 

Dave

---

## #43036 — Mikko Koppanen — 2009-02-13T21:55:33+00:00

URL: https://externals.io/message/43034#43036 · In reply to: #43034

On Fri, Feb 13, 2009 at 7:31 PM, David M. Patterson <
dpatterson@dplhenterprises.com> wrote:

> I am writing an extension that requires its own configuration file.
>
> I would prefer to not re-invent the parse a config file wheel and so, have
> been trying to use zend_parse_ini_file() function. Unfortunately, I have
> been unable to make this work, so far.
>
> If someone would either provide a code snippet for this or point me to one,
> I'd really appreciate it.
>

The normal way is to use PHP ini-entries. You can find examples in just
about every extension out there. Are you sure you need a separate
configuration file for your extension?


-- 
Mikko Koppanen
