资讯专栏INFORMATION COLUMN

初学phalcon

Arno / 1057人阅读

摘要:中定义了接口,其中声明了许多方法在文件夹中,有两个文件分别定义了两个子类以及许多方法。


这是我在phalcon中找到的关于image的文件,看了一下源码,大致了解了如何实现
image.zep文件中是定义了一个Image类,其中定义了一些常量
如下


在image文件夹中,adapter.zep中定义了一个抽象类Adapter,其中 定义了一些对象和很多方法,包括以下

public getImage () ... public getRealpath () ...
public getWidth () Image width public getHeight () Image
height public getType () Image type Driver dependent
public getMime () Image mime type
public resize ([unknown $width], [unknown $height],
[unknown $master]) Resize the image to the given size
public liquidRescale (unknown $width, unknown $height,
[unknown $deltaX], [unknown $rigidity]) This method scales the images
using liquid rescaling method. Only support Imagick
public crop (unknown $width, unknown $height, [unknown $offsetX],
[unknown $offsetY]) Crop an image to the given size
public rotate (unknown $degrees) Rotate the image by a given
amount public flip (unknown $direction) Flip the image along the
horizontal or vertical axis public sharpen (unknown $amount)
Sharpen the image by a given amount
public reflection (unknown $height, [unknown $opacity],
[unknown $fadeIn]) Add a reflection to an image
public watermark (unknown $watermark, [unknown $offsetX],
[unknown $offsetY], [unknown $opacity]) Add a watermark to an image
with the specified opacity public text (unknown $text,
[unknown $offsetX], [unknown $offsetY], [unknown $opacity],
[unknown $color], [unknown $size], [unknown $fontfile]) Add a text to
an image with a specified opacity public mask (unknown $watermark)
Composite one image onto another
public background (unknown $color, [unknown $opacity]) Set the
background color of an image public blur (unknown $radius) Blur
image public pixelate (unknown $amount) Pixelate image
public save ([unknown $file], [unknown $quality]) Save the image
public render ([unknown $ext], [unknown $quality]) Render the
image and return the binary string

摘自官方文档,未翻译。。。

adapterinterface.zep中定义了AdapterInterface接口,其中声明了许多方法

在adapter文件夹中,有两个文件分别 定义了两个子类以及许多方法。

Imagick.zep中定义的方法

public static check () Checks if Imagick is enabled
public __construct (unknown $file, [unknown $width],
[unknown $height]) PhalconImageAdapterImagick constructor
protected _resize (unknown $width, unknown $height) Execute a
resize.
protected _liquidRescale (unknown $width, unknown $height, unknown $deltaX, unknown $rigidity)
This method scales the images using liquid rescaling method. Only
support Imagick
protected _crop (unknown $width, unknown $height, unknown $offsetX, unknown $offsetY)
Execute a crop. protected _rotate (unknown $degrees) Execute a
rotation. protected _flip (unknown $direction) Execute a flip.
protected _sharpen (unknown $amount) Execute a sharpen.
protected _reflection (unknown $height, unknown $opacity, unknown $fadeIn)
Execute a reflection.
protected _watermark (unknown $image, unknown $offsetX, unknown $offsetY, unknown $opacity)
Execute a watermarking.
protected _text (unknown $text, unknown $offsetX, unknown $offsetY, unknown $opacity, unknown $r, unknown $g,unknown $b, unknown $size, unknown $fontfile)
Execute a text protected _mask (unknown $image) Composite one
image onto another
protected _background (unknown $r, unknown $g, unknown $b, unknown $opacity) Execute a background. protected _blur (unknown $radius) Blur image
protected _pixelate (unknown $amount) Pixelate image
protected _save (unknown $file, unknown $quality) Execute a save.
protected _render (unknown $extension, unknown $quality) Execute a
render. public __destruct () Destroys the loaded image to free up
resources. public getInternalImInstance () Get instance
public setResourceLimit (unknown $type, unknown $limit) Sets the
limit for a particular resource in megabytes
public getImage () inherited from PhalconImageAdapter ...
public getRealpath () inherited from PhalconImageAdapter ...
public getWidth () inherited from PhalconImageAdapter Image
width public getHeight () inherited from PhalconImageAdapter
Image height public getType () inherited
from PhalconImageAdapter Image type Driver dependent
public getMime () inherited from PhalconImageAdapter Image mime
type public resize ([unknown $width], [unknown $height],
[unknown $master]) inherited from PhalconImageAdapter Resize the
image to the given size
public liquidRescale (unknown $width, unknown $height,
[unknown $deltaX], [unknown $rigidity]) inherited
fromPhalconImageAdapter This method scales the images using liquid
rescaling method. Only support Imagick
public crop (unknown $width, unknown $height, [unknown $offsetX],
[unknown $offsetY]) inherited fromPhalconImageAdapter Crop an image
to the given size public rotate (unknown $degrees) inherited
from PhalconImageAdapter Rotate the image by a given amount
public flip (unknown $direction) inherited
from PhalconImageAdapter Flip the image along the horizontal or
vertical axis public sharpen (unknown $amount) inherited
from PhalconImageAdapter Sharpen the image by a given amount
public reflection (unknown $height, [unknown $opacity],
[unknown $fadeIn]) inherited from PhalconImageAdapter Add a
reflection to an image public watermark (unknown $watermark,
[unknown $offsetX], [unknown $offsetY], [unknown $opacity]) inherited
from PhalconImageAdapter Add a watermark to an image with the
specified opacity public text (unknown $text, [unknown $offsetX],
[unknown $offsetY], [unknown $opacity], [unknown $color],
[unknown $size], [unknown $fontfile]) inherited
from PhalconImageAdapter Add a text to an image with a specified
opacity public mask (unknown $watermark) inherited
from PhalconImageAdapter Composite one image onto another
public background (unknown $color, [unknown $opacity]) inherited
from PhalconImageAdapter Set the background color of an image
public blur (unknown $radius) inherited from PhalconImageAdapter
Blur image public pixelate (unknown $amount) inherited
from PhalconImageAdapter Pixelate image
public save ([unknown $file], [unknown $quality]) inherited
from PhalconImageAdapter Save the image
public render ([unknown $ext], [unknown $quality]) inherited
from PhalconImageAdapter Render the image and return the binary
string

Exception.zep中有如下方法

final private Exception __clone () inherited from Exception Clone
the exception public __construct ([string $message], [int $code],
[Exception $previous]) inherited from Exception Exception constructor
final public string getMessage () inherited from Exception Gets
the Exception message final public int getCode () inherited
from Exception Gets the Exception code
final public string getFile () inherited from Exception Gets the
file in which the exception occurred
final public int getLine () inherited from Exception Gets the line
in which the exception occurred
final public array getTrace () inherited from Exception Gets the
stack trace final public Exception getPrevious () inherited
from Exception Returns previous Exception
final public Exception getTraceAsString () inherited
from Exception Gets the stack trace as a string
public string __toString () inherited from Exception String
representation of the exception

我只是代码的搬运工,其中大部分都是文档上的,汇总一下,跪求大神能把官方文档翻译下来
看完这部分源代码,其实还是比较容易理解,然而时间有限没有深入了解,如果有机会要把每一个方法的实现再说一遍
第一次写这个,有问题一定要让我知道,逐渐努力

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/21321.html

相关文章

  • Phalcon入门教程之目录结构

    摘要:原文发表于入门教程之目录结构很多初学的朋友,对于以框架为基础构建的项目,应该如何组织目录结构有点摸不着头脑。只需要通过注册这些目录结构,即可正常使用。 原文发表于:Phalcon入门教程之目录结构 很多初学Phalcon的朋友,对于以Phalcon框架为基础构建的项目,应该如何组织目录结构有点摸不着头脑。比如多模块的项目中,如何共用libs类库和models目录中模型类的情况,就有很...

    reclay 评论0 收藏0
  • PHP7 安装Phalcon框架

    摘要:是什么是开源全功能栈使用扩展编写针对高性能优化的框架。也是松耦合的,可以根据项目的需要任意使用其他对象。安装支持版本的不支持普通方式的编译安装,只能通过安装。因此安装之前,请先安装。 Phalcon 是什么? Phalcon 是开源、全功能栈、使用 C 扩展编写、针对高性能优化的 PHP 5 框架。 开发者不需要学习和使用 C 语言的功能, 因为所有的功能都以 PHP 类的方式暴露出来...

    kidsamong 评论0 收藏0
  • phalcon使用经验杂谈

    摘要:初次认识是在刚学的时候最近终于有机会用上了故此说说使用上的一些感受个人是很喜欢这套框架的方式使用依赖注入让代码组织很灵活耦合也很低但是也许是框架东西太多了遇到几个坑上一年以上的也还没解决不过有一定开发经验的话还是可以自己修复的被这几个坑浪费 初次认识phalcon是在刚学php的时候,最近终于有机会用上了.故此说说使用上的一些感受 个人是很喜欢phalcon这套框架的方式,使用...

    UsherChen 评论0 收藏0
  • PhpStorm下提示Phalcon框架语法

    摘要:下载源码源码地址下载下载源码地址下载修改文件,指定生成语法文件到目前为止,会在目录下生成对应版本的目录在中导入最后重启 1、下载Phalcon源码 git clone https://github.com/phalcon/cphalcon.git 源码地址:下载 2、下载phalcon-devtools git clone https://github.com/phalcon/phal...

    luckyw 评论0 收藏0
  • PHP-Phalcon框架中的数据库操作

    摘要:本文描述了框架中数据库操作方法,主要讨论框架的组件中的操作方法。属性方法在框架中支持属性的扩展查询,在上例中,可以把条件语句改为同时省略查询条件结果不变。 本文描述了PHP-Phalcon框架中数据库操作方法,主要讨论Phalcon框架的Model组件中的操作方法。更详细的Model介绍请参考:官方文档 1. 连接数据库 在Phalcon框架中,通过在DI中注入db参数来实现数据库的...

    xiaotianyi 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<