phplaravelcomposer-phpthumbnailsphpthumb

How to use phpThumb with laravel?


Sure, phpThumb can be installed using composer. But what's next? Am I supposed to store phpThumb's config at vendor/james-heinrich/phpthumb/phpThumb.config.php? What exactly should I do? It's not documented.


Solution

  • So, to solve this I came up with a composer package. It's pretty hackish, so if you've got ideas, you're welcome.

    Using OO interface doesn't seem like an option. First, the readme says:

    Calling as an object (not using phpThumb.php):

    NOTE: most people don't need to and should not do this. If you just want to display resized images, please just use phpThumb.php, not the object mode. To render output to one (or more) files instead of the browser, you should skip phpThumb.php and instantiate your own object. Please take a look at /demo/phpThumb.demo.object.php for details.

    Note: phpThumb.php is where the caching code is located, if you instantiate your own phpThumb() object that code is bypassed and it's up to you to handle the reading and writing of cached files.

    And it doesn't solve the issue with config.