Coder Social home page Coder Social logo

Comments (8)

schmunk42 avatar schmunk42 commented on August 20, 2024 9

I'd find a common.php much more imporant. It would reduce the amout of duplicated config a lot.

_db.php
_urls.php
common.php
console.php
messages.php
web.php

When using sub-configs they should be indicated by some convetions, ie. _ dot-notation or even a subfolder components and/or modules.

components.db.php
components/db.php

components.urlManager.rules.php

from yii-base-web.

schmunk42 avatar schmunk42 commented on August 20, 2024 4

@samdark I don't really favour such a change, since it's harder to find a certain piece of configuration.
I'd prefer a very minimal config for the application template.

from yii-base-web.

omzy avatar omzy commented on August 20, 2024 2

Use Laravel's config structure as an example:

https://github.com/laravel/laravel/tree/master/config

Combined with .env file it is super simple to adjust config settings. I really don't like putting the actual values in the config files themselves and then doing if (YII_ENV_DEV) everywhere..

from yii-base-web.

samdark avatar samdark commented on August 20, 2024

Yes, could be done. Would you like to send a pull request?

from yii-base-web.

samdark avatar samdark commented on August 20, 2024

What do you mean by "harder to find a certain piece of configuration"? Any example of what would be harder to find in this case?

from yii-base-web.

schmunk42 avatar schmunk42 commented on August 20, 2024

In the example above there's ie. the database config read into $db, some other configs are required directly, but i18n is part of the web.php - there's no convention when to use require or a variable.

If I am looking for the cache configuraton I also need to look if it's also included in web and/or console. The more files you have the more logic is required to merge them. And there's currently no way to retrieve the merged configs from the application.

I'd rather prefer to split configs depending on YII_ENV and YII_DEBUG, than by component or module.

from yii-base-web.

schmunk42 avatar schmunk42 commented on August 20, 2024

We're using conventions to add -web or -debug to the config files, but it requires some logic to merge them: https://github.com/dmstr/phd5-app/blob/master/src/config/main.php

from yii-base-web.

allyraza avatar allyraza commented on August 20, 2024

everybody want a structure similar to laravel what I don't understand why don't you guys use laravel no offense it is great tool, if you are a yii user then own it I believe yii's current config structure is great and works for most cases although you have the flexibility to change how you like it.

from yii-base-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.