do i really need to use composer?

Mutikasa

Power Member
Joined
May 23, 2011
Messages
589
Reaction score
216
I am interested in this one https://github.com/Stichoza/google-translate-php library and it asks me to install over composer.
I don't wanna bother with that. How can I download just the files and do whatever I want to make it work?

EDIT: it's ok, it's easy to setup on wamp.
 
Last edited:
There is a download link on the page, I believe you can download, extract and upload those files direct to your host...
 
I would still recommend to use composer though. By not using composer you risk that you will miss certain dependencies that composer will otherwise take care of you. If the project is a complex one you are in fact guaranteed to miss dependencies without using composer.
 
you can download the zip from github or use git to clone the repository.
But...
use composer... be a men.. ;) lol
just try to work with tools that make your like easier in future dont be lazy
 
I would suggest to use composer. Get a decent framework (like Symfony) if you don't have experience with composer - this will help you to understand what a good architecture is.

I can see that this library has only one dependency (not including PHP itself). But that dependency (another library) may have its own dependencies. And this can continue for a while. It will be so time consuming and painful to find and download all the dependencies manually.
And if you use a lot of libraries, dependencies can also conflict with each other - you'll want to kill yourself when you bump into this for the first time. It will seem that the world is over. :)

Be smart. Use composer. It will be much easier to handle all these problems. And updating your dependencies will be as easy as installing them - by using a single console command.

Good luck!
 
Using composer makes things easier and includes required classes automatically, if you decide not to use it, you'd need to includes EVERYTHING manually.
 
Tools like composer are here to make you life easier. As everybody already mentioned it automates installation of dependencies and also generates autoload file. That is everything that you need for starting your own project. You need code to solve a particular problem like library you mentioned, one command and POOF! you have it and you can use it. When you start from zero you can have all libraries you need for your project in a matter of minutes.

For this library to work without composer you will need to do:
- include manually library you mention in the post (Stichoza/google-translate-php)
- include all dependencies of that library (also dependency of dependencies and so on...)
- make sure you load all files (there are some options, you need to make list of all files you need from all libraries and include them manually, or making some autoload class that will deal with that, or include in your composer.json library that is solving that issue, of wait you can not you don't want to use composer :D), also some libraries are using multiple psr autoloading standards (like library you want to use) so you will need to think about that also
- what if you do all of this and notice that you want to use some other major version on some library you have, your project will become nightmare
- and so on...

To make long story short, composer is a tool and should be used as such. It will save you a lot of time and will make your project easier to maintain and developer friendly. Composer is not perfect but it gets the job done. I use it on all of my projects no matter how small they are :)
 
Composer makes it a lot easier to update and install all dependencies the package might require to run smoothly. I suggest your use composer or try the manual route at your own risk
 
It's always recommended to use Composer and like people above said, you might miss some dependencies or have wrong versions of them which is not the best. Also it makes it really easy to move your project around and just install dependencies with 1 command.
 
Back
Top