Things like maintenance, website background, website title, favicon etc., where would it be best to store them? It would be single array of items. Do I just write it in flat CSV file, flat XML file, or use database for it (sounds pretty stupid to create single-row-table)?

(sorry for mess with tags, no idea how this question could be tagged)

Recommended Answers

All 2 Replies

It's up to you. I use arrays, like:


    return [
            'paths' => [
                'images' => '/path/to/images/directory/',
                'styles' => '/path/to/styles/directory/',
                # ...

            # ...

And/or dotenv:

One option is what cereal suggested that it may also be the most popular in PHP world. If you separate your source code from your public files and you have your src folder not in public_html (www) another option is to use a JSON format file for configurations.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.