Overwrite config file composer |
i have not done it ; but the basics are putting your code at your repo ,then adding a reference to that source into the composer.json file. So when you do say a composer update it will check against all entries in composer.json including your repo. Its on the composer docs. This seems to be the essence:
Code: {
thinking about it my approach would work if you were using additional packages, that you wanted to keep updated via your repo but you want to overwrite a core Class in Config Directory say Routes.php then actually i think one of the maintainers needs to answer this one.
If you want to write your own class then thats not difficult and i'm doing that . If its one of your classes then its only a case of giving it a namespace then making sure it can be found . If your class is within a Directory , that itself is inside app directory then for example i have a class called CheckSpam in a Directory called Andy : <?php namespace App\Andy; class CheckSpam { from a controller i can make use of my class via stating this in controller: use \App\Andy\CheckSpam; then from a method i instantiate class and use a method: $spamHandle = new CheckSpam(); //CheckSpam is in app/Andy and has namespace App\Andy $logic = $spamHandle->filterSpam($cleanMessage); f i do a composer update i'm pretty sure only items listed in composer.json will be updated/changed and my class's should be untouched ? |
Welcome Guest, Not a member yet? Register Sign In |