PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 21, 2022

[FIXED] How to create own autogenerated files by composer

 January 21, 2022     composer-php, symfony     No comments   

Issue

I'm working on project in Symfony 2. In this project, there's file named parameters.yml.dist which is base for composer to create parameters.yml. We have two environments (prod, dev), each one has own parameters file (for dev it's parameters_dev.yml).

My problem is that, some users and servers have different dev configuration, but file exists in repository - that makes deployment and work a little bit uncomfortable.

Is there a way to make that parameters_dev.yml file be autogenerated same as parameters for prod? I tried to create this *.dist file but that's not worked, maybe I have to do something else?


Solution

I found the solution. Parameters are managed by this bundle: https://github.com/Incenteev/ParameterHandler

That's how part of my composer.json file looks now:

"incenteev-parameters": [
    {
        "file": "app/config/parameters.yml"
    },
    {
        "file": "app/config/parameters_dev.yml"
    }
],

Funny, I searched composer.json in first place but didn't found anything.



Answered By - o0skar
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing