承接 afxsoft/phpimagecache 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

afxsoft/phpimagecache

Composer 安装命令:

composer require afxsoft/phpimagecache

包简介

Fork of https://github.com/nielse63/php-image-cache using psr-4 autoload and removing unused stuff.

README 文档

README

Image Cache is a very simple PHP class that accepts an image source and will compress and cache the file, move it to a new directory, and returns the new source for the image.

Installation

Install Composer by opening Terminal and navigating to the directory in which you'd like to install Image Cache.

Installation Execute this bash command from your project’s root directory:

composer require afxsoft/phpimagecache:dev-master

Basic Usage The class is pretty small, and very basic. First, include the file and initialize the class:

require_once 'ImageCache.php';
$imagecache = new Afxsoft\App\ImageCache();

Optional: Set the location of the directory to house your cached images:

$imagecache->cached_image_directory = dirname(__FILE__) . '/images/cached';

Next, reference the image that you want compressed and store the new image source in a variable. Echo this variable within the 'src' attribute of an image tag:

$cached_src = $imagecache->cache( 'images/unsplash1.jpeg' );
/// <!-- later in your HTML -->
<img src="<?php echo $cached_src; ?>" alt="Amazingly awesome photo">

统计信息

  • 总下载量: 34
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 104
  • 开发语言: PHP

其他信息

  • 授权协议: Creative
  • 更新时间: 2018-08-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固