Symfony Own Private Vendor - symfony

I have a private bundle that I import in the vendor.
Now, I'm working in my project and want to edit some code in the vendor bundle.
Now I've done that and want to commit to code, so I go the dir of that bundle and say: "git commit -a" so I give a message, save and now I have a commit. Oke, "git push" and give the response "Everything is up-to-date"... So I can't push that but I can commit??
Is this not a way to commit? Should I just clone the repo and work there?

You should never edit the vendor code directly - this is the whole point of dependency management.
Composer basically works by looking at your composer.json file, and fetching the repositories and versions you specify. If you need to make changes to one of your dependencies, you should make the change in the original repository, push the changes up to GitHub (or wherever you're hosting the code) and run composer update.

When Composer installs a vendor, it checks out a particular commit, so you are not on a branch. You need to checkout the master branch — or whichever you're using — and commit to it and push it.

Its a long time ago that I asked this question. Mean while I got the answer but never updated my stackoverflow question, sorry for that!
The answer on my own question is to get the dependency with composer --prefer-source.
https://getcomposer.org/doc/03-cli.md#install
--prefer-source: There are two ways of downloading a package: source and dist. For stable versions composer will use the dist by default. The source is a version control repository. If --prefer-source is enabled, composer will install from source if there is one. This is useful if you want to make a bugfix to a project and get a local git clone of the dependency directly.

Related

Why is SymfonyRequirements.php excluded from .gitignore?

If I understand it correctly, the SymfonyRequirements.php file (which lives under /app or /var depending on Symfony version) is handled by Composer. I therefore suppose it should be not be tracked by any version control system. However, I see it is excluded from Symfony Standard Edition's .gitignore file:
/var/*
[...]
!var/SymfonyRequirements.php
Edit
Symfony core developer #Stof says in a Github issue:
given that one of the checks is whether you installed vendors, it must
be there before installing them (even though we have an automatic
update of the requirements so that you check the uptodate ones next
time).
This is not very clear to me. Can anybody give any more details about this file and explain why it should or should not be tracked by a VCS?
This file is used by Symfony Check CLI Script to check for minimum requirements of configuring & running a Symfony App. It's a Common Post-Deployment Task.
It checks for current PHP Version/Configurations(php.ini settings) and required PHP Extensions. For example it checks for current setting of date.timezone.
What #stof is trying to say is that you should be able to run the checks even before installing dependencies using composer install. It even checks for dependencies installation itself: checks for existence of vendor/composer directory.
It gives you a good & enough insight about whether the Symfony App has what it needs to be run based on Current PHP configuration.
Note that by adding this file to VCS, you should know there may be changes to this file after updating dependencies later using composer update. So you should remember to commit this file too!.
Please Note that these checks also provide some recommendations(not requirements) to be set. For Example check this recommendation out:
When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)
Some other Projects using Symfony also implement their own checks by extending this file, For example checkout Oro Platforms Requirements Check.
The files is used in the check CLI tool that use this files for control the minimal Requirements for Running Symfony. You can find more info in the doc.
Usually is take into account in a version control system, as you can see in the symfony-standard distribution project on github:
https://github.com/symfony/symfony-standard
(of course you can add the files in your custom .gitignore files)
For more precision, this file is used in the command php bin/symfony_requirements in symfony3 and php app/check.php for older, that checks your php/symfony requirements.
See this question Should the changes of SymfonyRequirements.php be included in version control? and the documentation.

No default repositories in Qt Maintenance Tool

I recently installed Qt 5.5 and its MaintenanceTool (MaintenanceTool.exe). The default repositories were working, but after one day, my MaintenanceTool suddenly reported that no repositories were set.
I can temporarily enter individual repositories in the MaintenanceTool, but I would like to get the default repos set.
Why are they gone?
How can I set the default repositories again?
Thanks in advance
The Maintenance Tool is doing crazy things since the recent updates made by Qt team.
The only solution I know is:
Add the next temporary repository in "Settings":
Windows: http://download.qt.io/online/qt5/windows/x86/online_repository/
Mac: http://download.qt.io/online/qt5/mac/x64/online_repository/
Now, you can update the Qt components and you should see a new update for the Maintenance Tool.
If everything goes well, the Maintenance Tool will be fixed.
Note: The download speed of the default repo by Qt is quite slow (usually limited to 2mbps).
So you might want to use official mirrors to get much higher download speeds.
Here is some magic to quickly get those repo addresses:
Open the following url (which contains online repo components of Qt:
http://download.qt.io/online/qt5/windows/x86/online_repository/qt/
You'll see some files in that directory
Click on "Details" on the right side of any of those files.
This will show mirror links of the file such as:
http://ftp2.nluug.nl/languages/qt/online/qt5/windows/x86/online_repository/qt/1.0.0meta.7z
Cut the right side of any of those urls to make it end with online_repository.
It should be something like this afterward:
http://ftp2.nluug.nl/languages/qt/online/qt5/windows/x86/online_repository
And here we go! Now you can use that url as a repository which has higher download speeds.
As of today (2017 oct. 30) the Mac repo url http://download.qt-project.org/online/qtsdkrepository/mac_x64/root/qt worked for me
Manually added the repository as a custom repo.
Updated (only the maintenance tool was updated at that time it seems).
Relaunched the maintenance tool.
Deleted the custom repo because many repos were present in the default repositories list, then quit the maintenance tool.
Relaunched the maintenance tool and updated normally.
BTW: I used the offline installer for the first install on my Mac.
26th January 2022 : If you are using an old maintenance tool, you need to update the maintenance tool first by adding the repo 'http://download.qt-project.org/online/qtsdkrepository/windows_x86/desktop/tools_maintenance' under user defined repository following the above described steps and selecting "update components". Now you can add/remove the components such as QtCharts, Qt3D etc.

Composer revert after making changes

I am using composer to manage dependencies in a Drupal project. Some modules I have are in mercurial repositories. Once I do composer install I am able to download my Drupal modules from their respective mercurial repositories. The composer.lock file also gets generated correctly.
Now let's say I make changes in one of the repositories. After that, if I run composer install, I expect the changes to get reverted, so that the repository goes back to the revision stored in composer.lock.
But that does not happen. The changes I have made persist. Am I missing something? Is this because am using a mercurial repository?
If I understand this correctly, you change something in your vendor/project and you want to revert there changes, right?
If so, I usually remove vendor/project directory and install package again.

How To Clean a Development Build of a Meteorjs App?

There are two command line programs to start/stop/manage your meteor app. There is meteor and there is mrt. As of the latest build (0.8.2 or so) it's really not clear what the difference is between these two, if any. Both seem to support the argument "help" like meteor help and mrt help. The output of both seems to be the same to me.
Sadly, I do not see a "clean" argument available when I check the help for either of these. What do I need to do if I want to achieve a clean build? One that would
Blow away all packages and re-install them
Blow away any compiled templates
Blow away all Sass/Less compiled output
I ask this because I find myself in some kind of dependency Hades right now and want out now.
Meteor is still in a pre-release state. So the idea of packages is (still as of this post) not officially supported, though it will be soon. The meteor community stepped in to build their own way to use 3rd party packages and this is what meteorite does.
Most of the commands you give to meteorite are eventually passed to meteor which is why you see the same output.
The only (main difference is) mrt add which checks atmospherejs.com for packages first.
These two will be merged very soon (there is a branch on meteor on github called packaging which seeks to achieve this)
The idea of 'clean' isn't really there in meteor because most of the stuff is based on hot code reloads, so when a file changes its completely scrapped/(cleaned) and rewritten.
If you change a bit of code it will rebuild all this unless you have a syntax error.
Nonetheless if you want to 'clean' the build from everything you would have to do this in two steps (the meteor part and the meteorite part)
This erases some stuff in the hidden .meteor folder
meteor reset
Delete everything in ~/.meteorite/packages
Delete all symlinks only in your projects /packages folder. Be careful not to delete the folders because these will have been put in by you/whoever made your project and wouldn't be from atmosphere or meteor
Then run mrt update to reinstall all the atmosphere packages from scratch

How do I commit changes to Plone package hosted on github?

I want to commit to a Plone package. Do I include it with mr.developer? If yes, the code is in buildout-folder/src. After I made my changes, how do I commit with my existing github account? Should I use something different than mr.developer?
If you have a fork of the package in your github account, then using mr.developer is an excellent way to make local changes.
Just use normal git tools. The repository is indeed located in the src/ directory, just cd to it and use a normal git workflow. Then use GitHub to issue a pull request to the original package for your changes.
All mr.developer does is make it easier to switch buildout to use the development egg stored in src/ and to make the workflow of working with 1 or more repositories for eggs-under-development. It doesn't require you to do anything special with a version-control managed package.

Resources