PHPackages                             maxxxam/phumbor-yii - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. maxxxam/phumbor-yii

ActiveLibrary[API Development](/categories/api)

maxxxam/phumbor-yii
===================

Phumbor, yii2 lib

v0.1(9y ago)047MITPHPPHP &gt;=5.5.9

Since Jun 1Pushed 8y ago1 watchersCompare

[ Source](https://github.com/MaxXxaM/phumbor-yii)[ Packagist](https://packagist.org/packages/maxxxam/phumbor-yii)[ RSS](/packages/maxxxam-phumbor-yii/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Phumbor for Yii 2
=================

[](#phumbor-for-yii-2)

This extension allows you to implement interaction with Thumbor in Yii 2.

Install
-------

[](#install)

#### Dependency:

[](#dependency)

- [Базовое расширение Phumbor PHP](https://github.com/99designs/phumbor)

**1** Install via composer. Add the following code to the file `composer.json`.

```
{
	"require": {
		"maxxxam/phumbor-yii": "~0.1"
	}
}
```

**2** Install via composer

```
$ composer install
```

or update with existing packages

```
$ composer update
```

**3** Add the following into config app

```
'thumbor' => [
    'class' => 'PhumborYii\Phumbor',
    'server' => 'http://127.0.0.1',
    'uploadServer' => 'http://:',
    'secret' => '',
    'defaultFileName' => ''
],

```

Usage
-----

[](#usage)

### Upload files

[](#upload-files)

```
foreach ($_FILES as &$file){
    $urlUpload = Yii::$app->thumbor->upload($file);
}

```

### Get ID image

[](#get-id-image)

```
$idImage = Yii::$app->thumbor->getImageId($urlUpload);

```

### Remove file

[](#remove-file)

```
Yii::$app->thumbor->remove($idImage);

```

### Resize image (100 x 100)

[](#resize-image-100-x-100)

```
Yii::$app->thumbor->getUrlBuilder($urlUpload)->resize(100, 100);

```

Other available thumbor methods described [here](https://github.com/thumbor/thumbor/wiki/Usage)

Example classes for images manipulating
=======================================

[](#example-classes-for-images-manipulating)

```
class Image extends File implements ImageInterface
{
    public function getSrc():string
    {
        return Yii::$app->thumbor->getFullUrl($this->id_external);
    }

    public function getMeta($src = null): array
    {
        $source = $src ?: Yii::$app->thumbor->getUrlBuilder($this->getSrc(), true)->metadataOnly(true)->__toString();
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $source);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        $result = json_decode(curl_exec($curl), true);
        curl_close($curl);
        return $result['thumbor'] ?? null;
    }

    public function getVariants(){
        return new ImageVariants($this);
    }

}

```

```
interface ImageInterface
{
    public function getSrc():string;
    public function getMeta($src = null):array;
}

```

```
abstract class AbstractImageSize extends MagicMethods implements ImageInterface
{
    private $_image;

    public function __construct(ImageInterface $image)
    {
        $this->_image = $image;
    }

    private function getUrlBuilder($source, $uploadServer = false): Builder{
        return \Yii::$app->thumbor->getUrlBuilder($source, $uploadServer);
    }

    public function getSrc():string
    {
        $builder = $this->getUrlBuilder($this->_image->getSrc());
        return $this->applyActions($builder)->__toString();
    }

    public function getMeta($src = null):array
    {
        $builder = $this->getUrlBuilder($this->_image->getSrc(), true);
        $path = $this->applyActions($builder)->metadataOnly(true)->__toString();
        return $this->_image->getMeta($path);
    }

    /**
     * Apply filters
     * @param Builder $builder
     * @return mixed
     */
    abstract protected function applyActions($builder);

}

```

```
class ImageSmall extends AbstractImageSize
{

    /**
     * @inheritdoc
     */
    protected function applyActions($builder){
        return $builder->resize(100, 100);
    }

}

```

```
class ImageVariants extends MagicMethods
{
    private $_image;

    public function __construct(ImageInterface $image)
    {
        $this->_image = $image;
    }

    public function getSmall():ImageSmall{
        return new ImageSmall($this->_image);
    }

    ...

}

```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3316d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0aff407c77b81b365828415460c6ece8d2590bd6e630a566c3aba18b1880817b?d=identicon)[MaxXxaM](/maintainers/MaxXxaM)

---

Tags

graphqlyii2

### Embed Badge

![Health badge](/badges/maxxxam-phumbor-yii/health.svg)

```
[![Health](https://phpackages.com/badges/maxxxam-phumbor-yii/health.svg)](https://phpackages.com/packages/maxxxam-phumbor-yii)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
