I'm trying to upload my edited (custom) versions of some vendor packages
Example I edited some code in
vendor/misd/linkify/src/Misd/Linkify
I changed a few lines to work for my project.
The problem is when i push my project to github then deploy using envoyer , All the vendor files get reinstalled via composer update, thus grabbing from the GitHub repo
I need to be able to upload my own version of that specific vendor folder/file
I've tried whitelisting specific vendor file via gitignore , heres my original question Uploading Specific Vendor files with Laravel's Envoyer
But with no luck. Is this good practice, should I be going about it a different way? How can I get my modified version up to my server
Unless you have write access to the Vendor Project, you won't be able to push changes. You need to fork the Misd/Linkify vendor project and make changes and push to your fork.
Then use Composers Repository Package pattern and provide the path to the forked project.
If it is a private repository refer https://getcomposer.org/doc/05-repositories.md#using-private-repositories
Related
The case is that I have a main project using a composer lib made by someone on my team, and I don't have write access in this lib repository, so any change done in this lib needs to be commited, pull requested and published to be updated in the main project (by composer update).
Is there some way to link this lib folder on my main project, to my locally forked source, so I can use my own changes skiping this whole proccess?
P.S. I can't change the source on composer.json. It would be good if we can overwrite some items in composer using like as composer-custom.json as we can do in the Vagrant settings.
I have some great code I want to share....so I am moving code from my laravel 5 app into individual packages for use through composer/packagist.
This will also allow me to separate out code I only want in development and avoid deployment of nasty database modification classes to production.
I am confused on setting up git. My main project is running on a git repository. I am developing the packages under a sub-folder named packages/myname/package_name1/ . Each package is going to want its own git repository.
Should I add the folder "packages" to my .gitignore file for my main repository, then set up a git repository for each subfolder?
I followed this tutorial: Setup Laravel 5 Package
If you're using composer/packagist then yes, you should add the folder packages to .gitignore on your main repository. When deploying the entire application or when updating a package you'll have to do a composer install/update to keep everything up to date.
I've done lot of Google but still looking for solution, I'm working on Laravel5 project & wants to set it up with GitHub so multiple developer can work on it.
I've install Laravel & place in a repository on Git, Now I cloned it on my local machine & another developer also clone that repository in his machine and start working.
But issue is that, I have installed a package for HTML forms in my machine by composer & push my code to github. But when another developer pull the repository then his code is break because composer.js is updated for that package but actually that HTML package is not exists on his machine.
Can anyone help me to short out this, or is there any way so we ignore vendor folder, composer.js, app.php etc files during git Push?
To answer your question specifically, yes you could choose to ignore the vendor folder, composer.json and app.php files when you push to git. To do this, you would simply need to update your .gitignore file to reflect this. I.e, include these in your .gitignore:
/vendor
composer.json
/config/app.php
But then the next question is whether you really want to do this, as doing so would mean that changes you make - and any subsequent pushes - may not be compatible with work the other developer is doing down the track.
If you exclude the /vendor file and the /config/app.php file but leave the composer.json file in there now that the other developer already has a copy of the core files, the updated composer.json file they download would allow them to use composer install to update the project with the new package.
However all of this would be problematic for a developer who joins you down the track and doesn't have any of the current files.
I had a website created in Laravel 4.2, its live and had to make some changes in it. To make these changes I had to use a package that wasn't used before, so I required the package and did composer update.
The new package that I've used, has created a folder inside app/config/packages.
Besides the controllers and views where I've made the changes, what files I'll have to upload now? Composer update command has updated a few packages and downloaded the new one.
I just want to know whether I'll have to re-upload whole site or there are some specific files or folders that I can upload and get the website working perfectly.
Ok, I have spent good time over this and figured it out.
Changes due to newly installed package:
I used a package to export data to excel Maatwebsite/Laravel-Excel. I had to to add service provider, alias and do composer update. The package created few config files in app/config/packages/maatwebsite folder.
Other Changes:
Apart from above mentioned things, when I did composer update, it updated composer, symphony, monolog, phpoffice and autoload.php inside vendor folder. It also created new folder called maatwebsite inside vendor. Apart from these, the views and controllers I changed myself to export data to excel.
So, I basically uploaded all the following to my website:
controller, views files I changed.
composer.json & composer.lock files.
Files & Folders inside vender (vendor/autoload.php, vendor/composer, vendor/symfony, vendor/phpoffice, vendor/maatwebsite)
Config files of newly installed package i.e. (app/config/packages/maatwebsite)
Finally my app/config/app.php file where I added service provider and alias
And the website is working perfectly fine. So there was no need to upload everything. :)
Hope this will be helpful for others.
If you have a proper deployment plan, having the composer update command run once the code has been deployed would fix all of that. Otherwise, you're going to have to upload everything that is new, and everything that has changed.
If the directory is empty, you're going to have to manually create it on the server. I would imagine that besides that directory, it'd be any published content, such as configs and what not, the package folder, composer.json and the composer autoload.
I'm trying to add a missing feature to a bundle. Here is what I've done so far:
Spoke to the project owner and got their approval
Created a fork and cloned it locally into a directory outside of my project
Made a feature branch
Ran composer install
Now, the question is, how can I include this into my own Symfony project so that it would be autoloaded? I want to test my changes inside my own project before I send a pull request.
See How to require a fork with composer, to be specific, require a VCS repository as described in Composer docs
Or a bit faster way for improving developing process (which is independent on Github), try using local repositories.
You can archive in two manner:
You can hack the vendor folder replacing the folder of the bundle with a symlink of the third-party bundle
[RECOMENDED] Put in the composer.json file of your project the reference of your personal github project instead of the official version