strukt / pkg-asset
简单资产查找器
v1.0.7-alpha
2023-07-30 11:40 UTC
Requires
- erusev/parsedown: ^1.7
- gumlet/php-image-resize: dev-master
- league/html-to-markdown: ^5.0
- strukt/contract: v1.0.4-alpha
- strukt/fs: 1.1.0
This package is auto-updated.
Last update: 2024-09-06 20:06:40 UTC
README
安装
composer require strukt/pkg-asset:v1.0.6-alpha
如果需要,您需要安装中间件、提供者和命令
./console publish:package pkg-asset
简单资产管理器
$finder = new \Strukt\Asset($root_dir, $static_dir); $finder->exists("/js/script.js"); $finder->getInfo("/js/script.js");//SplFileInfo $finder->get("/js/script.js");//returns contents of file
图片缩放
$image = new \Gumlet\ImageResize(); $image = new \Gumlet\ImageResize('image.jpg'); $image->scale(50); $image->save('image2.jpg') $image = new \Gumlet\ImageResize('image.jpg'); $image->resizeToHeight(500); $image->save('image2.jpg')
有关更多关于 Gumlet 的信息,请参阅 Github 上的 Gumlet/ImageResize。