Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
This may be a pretty naive question, but I am trying to understand the difference in utility between Git's Subtree and Composer dependency management for PHP. I started using Git Subtrees after dumping Git Submodules. But now there is Composer (for PHP). As most of my projects are PHP based, I am thinking of dumping Subtrees in favor of Composer.
For example, I have multiple Wordpress sites. I would like to pull Wordpress itself and the plugins I want to use. I can achieve that with both Git Subtrees and Composer, right?
IF I don't have a use-case to commit/push code in a sub-folder upstream, but only wish to pull the latest/specific version into the sub-folder, do Subtree and Composer provide the same kind of utility?
In my use case, I feel that Composer trumps Git Subtree by being easier to use, easier to get another/newer version of a script in a sub-folder, without getting those pulled sub-folder files committed into Git repo.
Any thoughts on this understanding of mine? Is there a problem in this sort of strategy? Or both of them are totally different and don't have any similarities?
Lots of reasons favor Composer.
It actually manages dependencies of a whole project and vendor libraries themselves. So if you require a package it will get all required stuff or notify you about errors.
Managing versions is also trivial, as for every package you download you can specify version it should be updating to (so you can decide to only update minor releases of a package or go full-out with dev-master)
Composer provides some help with autoloading too. Making your project a little bit faster when run with -o
Having development only packages also allows you to manage production settings easier.
I find literally no reason for using submodules if vendor provides composer functionality.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Sometimes a feature that I want to create for my laravel application already exists as a package.
It is easy to install them, but I am worried about their impact on the application performance.
What should I consider when choosing whether to install a package or develop a feature by myself?
It's personal preference at the end of the day.
Some packages are well written, optimized and maintained and this gives you so many benefits:
Reduced maintainence cost (i.e. you aren't 100% responsible for fixing the package code)
Decreased development time (i.e. you don't have to write it)
Increased functionality (i.e. they may have features you hadn't even thought of)
Other packages are poorly written, un-optimized and in some cases obsolete. These can have the opposite effect:
Increased maintainence cost (i.e. the author isn't neccesarily going to fix an issue)
Increased development time (i.e. you will probably have to learn their code base and fix issues yourself)
My advice would be to make sure that if it's a well respected author/company and their code base is activily being worked on (check github / npm / etc), then using the package will likely save you time and hassle in the long run.
You aren't likely to see any massive performance degredation by using composer packages over writing it yourself!
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
In our company we currently do not use composer, we just download and store all libs under git.
What arguments can be given to our customers and system administrators to convince them of the need to use composer?
Our request must be substantiated enough to make a decision.
With Composer you get the following advantages:
The dependencies required by the package you are pulling in are automatically taken care by Composer itself, leaving you free to focus on the programming instead of dependency management.
When the package you are using gets a new version, a simple composer update will do everything for you without ever needing to do any file management manually.
With Composer you get a centralized autoload.php file which also be optimized for production. It loads everything you need and all you need to do is include one file. The optimized version is super fast! Simply do composer dump-autoload -o.
You can use psr-4 namespaces to load a specific path on your application and have it be included in the autoloader file. Then you can simply use the namespace and it's available application wide!
Look at the following URL for a more detailed list of features: https://getcomposer.org/doc/01-basic-usage.md
There are a lot more things you can do with Composer and it's wonderful. I highly advise that you guys use it and stop wasting time on managing packages yourself.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I m thinking about right deployment strategy for PHP (or any) web application.
I have versioned code (git) which contains source codes like LESS, non minified JavaScript etc.
As ideal steps I see this ones:
Build app to /build directory - including compile LESS, minify JavaScript and others. In build directory will be everything ready for deployment.
Run other necessary scripts like tests etc. in /build directory
After this steps I'm a bit confused what to do next.
Whole /build directory should be copied to staging/production server, but before I was actually building app I've used to copy only files which changed from last Git commit. Copying all files seems to be inefficient for me. However versioning /build directory doesn't seem to be right thing as well.
Other possibility is to create /build directory but it seems to be too messy to have built and non built files together and all versioned.
How do you build and deploy web applications?
If you use Jenkins/Hudson CI then you can use different publish plugins which may be executed after successful build. Most of plugins allow you to say exactly what you want to be published and over what protocol.
Basically you run full build on Jenkins, then deliver your build files and artifacts to production server.
Look at Publish Over SSH or Publish Over FTP. Both plugins allow you to configure "Transfer Set" and if you uncheck "Clean remote" checkbox then plugins will only send out files that are different from your production host.
PS: I made an assumption that you use CI server of some sort given tag "continuous-integration"
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm fairly new to Github (to versioning in general) and have some questions. I looked in a lot of FAQ's etc. about this topic, but I can't find clear answers to my (maybe unclear) questions.
(I formed my questions below, keep in mind that it is all about a PHP framework I use to create small websites.)
Q1: I'm working on 2 computers. I use GitHub for Mac on both machines, so I can work localhost (clone a rep) and let it update the changes online. If I change a clone on one computer, commit the changes, will it automatically update the clone on my other machine? How does it work?
Q2: So I have a repository of a PHP Framework. How do I point out, label,... a version as stable/beta/...? So that while I'm updating the latest version, I will always we able to download a stable version. Is there "such function" provided on GitHub?
Q3: I already created small websites with this PHP Framework. After a few weeks, I have some updates in my PHP Framework repo on GitHub. How can I check which files I need to update in these created websites?
I hope I'm clear with my questions, any help is highly appreciated!
Thanks in advance!
Q1: No. Commiting to a GIT repository means commiting to your local repository. To make your changes available to others (ot your other computer) you have to push them to the central repository (github in your case) and than pull it from the other locations.
Q2: Git supports tagging. This means you mark a revision with a label e.g. "1.0.0 beta" or whatever. You can use this label when you checkout elsewhere, so you can checkout the exact same revision "1.0.0 beta" as you marked it earlier. (See git tag --help for more information)
Q3: I would recommend always changing the whole Framework. This might be some kB more traffic, but you don't need to worry wich files should I change. When you want to upgrade to the framework "1.0.0 beta" as tagged earlier and you change all files, there is no risk that you forgot something.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Like PHP and ubuntu.
Is there a convenient way to see the modification alive?
Many open source projects are compiled with those three steps:
./configure
make
sudo make install
The first checks for dependencies and creates a makefile that matches your installation.
The second does the actual compilation and the third one installs it into /usr/bin or whereever it goes.
If you want to modify the code, I recommend you first do the above steps on the unmodified code, to make sure your tool chain actually works as expected.
Each project is different. Most projects have a "How to build" section in their documentation.
To keep up to date with changes in the code I would recommend joining the appropriate mailing list or whatever discussion mechanism the project uses.
You could also subscribe to the RSS feed of the source control or ticket/bug system used by the project.
For the two projects you mentioned have a look at the following sites:
PHP
Using PHP with SVN
Using SVN for PHP Development
PHP Bugs
Ubuntu
Ubuntu Development
Ubuntu Launchpad