{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/issues/148","repository_url":"https://api.github.com/repos/yiisoft/yii2-app-advanced","labels_url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/issues/148/comments","events_url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/issues/148/events","html_url":"https://github.com/yiisoft/yii2-app-advanced/pull/148","id":148965183,"number":148,"title":"Update start-installation.md","user":{"login":"OndrejVasicek","id":3864012,"avatar_url":"https://avatars.githubusercontent.com/u/3864012?v=3","gravatar_id":"","url":"https://api.github.com/users/OndrejVasicek","html_url":"https://github.com/OndrejVasicek","followers_url":"https://api.github.com/users/OndrejVasicek/followers","following_url":"https://api.github.com/users/OndrejVasicek/following{/other_user}","gists_url":"https://api.github.com/users/OndrejVasicek/gists{/gist_id}","starred_url":"https://api.github.com/users/OndrejVasicek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndrejVasicek/subscriptions","organizations_url":"https://api.github.com/users/OndrejVasicek/orgs","repos_url":"https://api.github.com/users/OndrejVasicek/repos","events_url":"https://api.github.com/users/OndrejVasicek/events{/privacy}","received_events_url":"https://api.github.com/users/OndrejVasicek/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-04-17T15:54:45Z","updated_at":"2016-04-18T09:27:24Z","closed_at":"2016-04-17T16:52:22Z","pull_request":{"url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/pulls/148","html_url":"https://github.com/yiisoft/yii2-app-advanced/pull/148","diff_url":"https://github.com/yiisoft/yii2-app-advanced/pull/148.diff","patch_url":"https://github.com/yiisoft/yii2-app-advanced/pull/148.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Is bugfix?    | yes\r\n| New feature?  | no\r\n| Breaks BC?    | no\r\n| Tests pass?   | \r\n| Fixed issues  | \r\n\r\nIf you edit directly the config in common folder, after another “init execution”, it’ll override you setting. So if I understand correctly, you should write you db connection into environment/dev folder instead and then run the “init”, which copy your environment/dev config. So after any other init, it overrides by the correct file."},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/issues/comments/211293583","html_url":"https://github.com/yiisoft/yii2-app-advanced/pull/148#issuecomment-211293583","issue_url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/issues/148","id":211293583,"user":{"login":"OndrejVasicek","id":3864012,"avatar_url":"https://avatars.githubusercontent.com/u/3864012?v=3","gravatar_id":"","url":"https://api.github.com/users/OndrejVasicek","html_url":"https://github.com/OndrejVasicek","followers_url":"https://api.github.com/users/OndrejVasicek/followers","following_url":"https://api.github.com/users/OndrejVasicek/following{/other_user}","gists_url":"https://api.github.com/users/OndrejVasicek/gists{/gist_id}","starred_url":"https://api.github.com/users/OndrejVasicek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndrejVasicek/subscriptions","organizations_url":"https://api.github.com/users/OndrejVasicek/orgs","repos_url":"https://api.github.com/users/OndrejVasicek/repos","events_url":"https://api.github.com/users/OndrejVasicek/events{/privacy}","received_events_url":"https://api.github.com/users/OndrejVasicek/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T09:27:24Z","updated_at":"2016-04-18T09:27:24Z","body":"Ok, I probably didn’t fully understand the concept of “-local” before. So please Samdark, could I share some of my thoughts, and then you tell me if I’m correct or wrong, shall we?\r\n\r\nLet’s take some info from here https://github.com/yiisoft/yii2-app-advanced/blob/master/docs/guide/structure-environments.md (btw is there any reason why the link to advanced template in guide doesn’t work?)\r\n\r\n> Each environment is represented by a set of files under the environments directory. The init command is used to switch between these. What it really does is copy everything from the environment directory over to the root directory where all applications are.\r\n\r\nSo, this should be used when I prepare release into master branch and when I switch back to develop branch. Therefore I can easily switch all the settings and params in all the folders.\r\nBut my mistake was that I wanted to switch even the “-local” files, where for example the database connections is. And that’s wrong from two reasons:\r\n\r\n1. “-local” files in environment aren’t in gitignore (they can’t be for obvious reasons) and they’d become a part of repository\r\n\r\n2. I mustn’t edit “-local” files “for everyone”, because they are related to the local environment – server for example connects to localhost, at home I connect to my local database, at office I could connect to a server in company network, etc\r\n\r\nBut there was still 1 thing I thought this concept was supposed to solve, but I guess it doesn’t – what if I have different db connections for production and development? If I Ignored the two previous reasons, I could do that, but only for me – one local environment, which is obviously wrong and what I was thinking of.\r\n\r\nSo in the end I suppose I have to put a condition into my “-local” files to check what environment I’m right now and chose the correct connection for my local machine, server, work station, test server, .... Am I correct?\r\n\r\nThanks for your effort and your work on Yii again.\r\n"}}