{"id":15089271,"url":"https://github.com/lireincore/yii2-imgcache","last_synced_at":"2025-04-11T15:32:17.837Z","repository":{"id":62517665,"uuid":"85339646","full_name":"lireincore/yii2-imgcache","owner":"lireincore","description":"The imgcache integration for Yii2 framework","archived":false,"fork":false,"pushed_at":"2019-11-10T13:51:11.000Z","size":14,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-25T15:35:23.668Z","etag":null,"topics":["cache","effect","image","php","preset","resize","thumb","thumbnail","yii2","yii2-extension"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lireincore.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.MD","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-17T17:47:11.000Z","updated_at":"2020-03-20T13:11:37.000Z","dependencies_parsed_at":"2022-11-02T10:31:12.988Z","dependency_job_id":null,"html_url":"https://github.com/lireincore/yii2-imgcache","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lireincore%2Fyii2-imgcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lireincore%2Fyii2-imgcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lireincore%2Fyii2-imgcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lireincore%2Fyii2-imgcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lireincore","download_url":"https://codeload.github.com/lireincore/yii2-imgcache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248431697,"owners_count":21102251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","effect","image","php","preset","resize","thumb","thumbnail","yii2","yii2-extension"],"created_at":"2024-09-25T08:41:55.971Z","updated_at":"2025-04-11T15:32:17.622Z","avatar_url":"https://github.com/lireincore.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image effect, thumb and cache extension for Yii2\n\n[![Latest Stable Version](https://poser.pugx.org/lireincore/yii2-imgcache/v/stable)](https://packagist.org/packages/lireincore/yii2-imgcache)\n[![Total Downloads](https://poser.pugx.org/lireincore/yii2-imgcache/downloads)](https://packagist.org/packages/lireincore/yii2-imgcache)\n[![License](https://poser.pugx.org/lireincore/yii2-imgcache/license)](https://packagist.org/packages/lireincore/yii2-imgcache)\n\n## About\n\nThe [lireincore/imgcache](https://github.com/lireincore/imgcache) integration for Yii2 framework.\n\n## Install\n\nAdd the `\"lireincore/yii2-imgcache\": \"^0.6\"` package to your `require` section in the `composer.json` file\n\nor\n\n``` bash\n$ php composer.phar require lireincore/yii2-imgcache\n```\n\n## Usage\n\nTo use this extension, you need to create the `imgcache.php` file in your `config` folder and add this code:\n\n```php\n\u003c?php\n\nreturn [\n    'srcdir' =\u003e '@app/files/images',\n    'destdir' =\u003e '@webroot/thumbs',\n    'webdir' =\u003e '@webroot',\n    'baseurl' =\u003e '@web',\n    //....\n    'presets' =\u003e [\n        'origin' =\u003e [\n            'effects' =\u003e [\n                //add the effects you need\n                //....\n            ],\n        ],\n    ],\n];\n```\n\nSee `lireincore/imgcache` [README.md](https://github.com/lireincore/imgcache/blob/master/README.md) for more information about the available effects and other config options.\n\nAlso add the following code in your Yii2 application configuration:\n\n```php\n$config = [\n    //....\n    'container' =\u003e [\n        //....\n        'singletons'  =\u003e [\n            //....\n            LireinCore\\Yii2ImgCache\\ImgCache::class =\u003e [\n                ['class' =\u003e LireinCore\\Yii2ImgCache\\ImgCache::class],\n                [\n                    require(__DIR__ . '/imgcache.php'),\n                ]\n            ],\n        ]\n    ],\n];\n```\n\nUse in your code:\n\n```php\nuse LireinCore\\Yii2ImgCache\\ImgCache;\n\n$imgCache = Yii::$container-\u003eget(ImgCache::class);\n\n// get thumb url for image '{srcdir}/blog/image.jpg' (preset 'origin')\n$url = $imgcache-\u003eurl('blog/image.jpg', 'origin');\n\n\n// get thumb url for image '{srcdir}/blog/image.jpg' (preset 'origin')\n$url = \\Yii::$app-\u003eimgcache-\u003eurl('blog/image.jpg', 'origin');\n```\n\nSee `lireincore/imgcache` [README.md](https://github.com/lireincore/imgcache/blob/master/README.md) for more information about the available functions.\n\n## License\n\nThis project is licensed under the MIT License - see the [License File](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flireincore%2Fyii2-imgcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flireincore%2Fyii2-imgcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flireincore%2Fyii2-imgcache/lists"}