1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

do i really need to use composer?

Discussion in 'PHP & Perl' started by Mutikasa, Sep 13, 2015.

  1. Mutikasa

    Mutikasa Power Member

    Joined:
    May 23, 2011
    Messages:
    581
    Likes Received:
    207
    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: Sep 13, 2015
  2. davids355

    davids355 Jr. VIP Jr. VIP

    Joined:
    Apr 25, 2011
    Messages:
    9,845
    Likes Received:
    7,467
    Home Page:
    There is a download link on the page, I believe you can download, extract and upload those files direct to your host...
     
  3. mantic0re

    mantic0re Junior Member

    Joined:
    May 29, 2015
    Messages:
    118
    Likes Received:
    9
    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.
     
  4. revproxy

    revproxy BANNED BANNED Jr. VIP Premium Member

    Joined:
    Nov 20, 2015
    Messages:
    396
    Likes Received:
    100
    Gender:
    Male
    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
     
  5. flaveris

    flaveris Newbie

    Joined:
    Jul 12, 2013
    Messages:
    16
    Likes Received:
    2
    Occupation:
    Web Developer
    Home Page:
    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!
     
  6. phpdevsami

    phpdevsami Newbie

    Joined:
    Dec 31, 2015
    Messages:
    13
    Likes Received:
    1
    Gender:
    Male
    Home Page:
    Using composer makes things easier and includes required classes automatically, if you decide not to use it, you'd need to includes EVERYTHING manually.
     
  7. Robier

    Robier Newbie

    Joined:
    Dec 31, 2015
    Messages:
    1
    Likes Received:
    1
    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 :)
     
  8. Oz0102

    Oz0102 Jr. VIP Jr. VIP

    Joined:
    Jun 28, 2010
    Messages:
    1,053
    Likes Received:
    302
    Gender:
    Male
    Location:
    world wide web
    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
     
  9. Diplomat

    Diplomat Jr. VIP Jr. VIP

    Joined:
    Oct 25, 2011
    Messages:
    949
    Likes Received:
    441
    Home Page:
    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.