thephpleague / color-extractor

Extract colors from an image like a human would do.

Home Page:thephpleague.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use this without Composer

xberg opened this issue · comments

commented

Hi,
I have no idea what Composer is. I do not have command line access on my server.
Is there a way to use your package without Composer?
Thanks

Composer is a tool for managing PHP dependencies.
You can read more about it here: https://getcomposer.org/doc/00-intro.md#introduction

It also provides an autoloader for classes. You can autoload all classes
by requiring vendor/autoload.php.

You can see what the library depends on in the composer.json file.
https://github.com/thephpleague/color-extractor/blob/master/composer.json

In this case there are no dependencies but gdlib and php >=5.4.0

You should look into composer. It's cool.

If you can't use conmposer on your server i recommend you one of the following:

  • Install composer on the server
  • switch server to one where you can install composer
  • use composer locally and upload all the files

You can use this without composer though... you have to require all the classes you use by yourself.
In this case this 3 files: https://github.com/thephpleague/color-extractor/tree/master/src/League/ColorExtractor

that you can use it as in the docs.

BUT

extracting the colors of images are expensive tasks. You should propably not run them during the users request. Prefer to run it manually in the background or something.

And you really should look into composer. There are so many nice packages installable through a single command.

The Question is not a bug, too. If you need help with using it you're maybe better with posting your question to stackoverflow.

Thanks @psren