razor/watermarker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

razor/watermarker

Composer 安装命令:

composer require razor/watermarker

包简介

An image watermark service module for Zend Framework 2

README 文档

README

Build Status Coverage Status Dependency Status Latest Stable Version Total Downloads Latest Unstable Version License

An image watermark service module for Zend Framework 2

Install with Composer

{
 "repositories": [
       {
           "type": "vcs",
           "url": "https://github.com/kaiohken1982/Watermarker.git"
       }
   ],
   "require": {
       ......,
       "razor/watermarker" : "dev-master"
   }
}

Configuration

Take the file config/watermarker.local.php.dist, rename it depending on your environment, remove the dist suffix and add it inside you autoload directory. You can set the value for these two path

  • watermarkFile: the physical path where your watermark is located
  • tmpDir: the physical path for elaborated watermark
return array(
   'watermarker' => array(
       'watermarkFile' => '/path/to/watermark.gif',
       'tmpDir' => '/path/to/tmp'
   ),
);

How to use

In a controller

   $watermarker = $this->getServiceLocator()->get('Watermarker');
   $watermarker->openImage('/path/to/image.jpg');
   
   // This line is not needed if watermark file is given within configuration file
   $watermarker->openWatermark('/path/to/watermark.gif');
   $watermarker->watermark();

Run unit test

Please note you must be in the module root.

curl -s http://getcomposer.org/installer | php
php composer.phar install
./vendor/bin/phpunit 

If you have xdebug enabled and you want to see code coverage run the command below, it'll create html files in Watermarker\test\data\coverage

./vendor/bin/phpunit --coverage-html data/coverage

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-09-07