phalcon

I’ve written about Phalcon before, and we’ve got a variety of articles on the framework published already, which is apparent if you just visit the Phalcon category. In fact, not so long ago, I wrote about Zephir, Phalcon’s noble initiative to make building PHP extensions accessible to everyone.

之前,我已经写过有关Phalcon的文章,并且已经发布了有关该框架的各种文章,如果您只是访问Phalcon类别 ,这是显而易见的。 实际上,不久前,我写了有关Zephir的文章 ,这是Phalcon的崇高倡议,旨在使所有人都能访问构建PHP扩展。

Today, a new milestone has been reached by the team, and one that definitely warrants discussion. Way ahead of time, the Phalcon team announced the imminent release of Phalcon 2.0 alpha 1.

今天,团队已经达到了一个新的里程碑,而且绝对值得讨论。 Phalcon团队提前宣布即将发布Phalcon 2.0 alpha 1 。

猎鹰2 (Phalcon 2)

Phalcon 2 is a full rewrite of the original Phalcon Framework, in their new language, Zephir. As previously discussed, Zephir is a mixed-type derivative of PHP (both static and dynamic types are supported) which allows developers to write “almost-PHP” code and compile it down to C based extensions for PHP, installable like any other (iconv, imap, imagick, etc). Phalcon 2 was built almost entirely in this language, and is now easier than ever to maintain, update and above all – accept contributions from the community. As proof of working concept, the Phalcon team is running their site on Phalcon 2 here.

Phalcon 2以其新语言Zephir完全重写了原始Phalcon框架。 正如前面所讨论的 ,ZEPHIR是PHP(静态和动态类型的支持),它允许开发者写“几乎PHP”代码和编译它下降到C基扩展PHP的混合型衍生物,安装像任何其他(的iconv ,imap,imagick等)。 Phalcon 2几乎完全是用这种语言构建的,现在比以往任何时候都更易于维护,更新,最重要的是-接受社区的贡献。 作为工作理念的证明,Phalcon团队正在此处的 Phalcon 2上运行其站点。

Phalcon 2.0 is being brought up to speed with the current version 1.3 (it introduced some optimizations not present and yet required in 2.0), and is being built around existing 1.3 classes to ensure backwards compatibility. To see which classes were ported so far, observe the following table. If you’d like to assist in the transfers, submit a pull request as you see fit – particularly unit tests. Most of the ported components simply haven’t been tested yet, even after being fully developed.

Phalcon 2.0正在与当前版本1.3(它引入了一些尚不存在但2.0中尚需的优化)一起加快发展,并围绕现有的1.3类进行构建以确保向后兼容。 要查看到目前为止已移植了哪些类,请观察下表 。 如果您想协助转移,请提交您认为合适的请求-特别是单元测试。 甚至在完全开发之后,大多数移植的组件都尚未经过测试。

Zephir和创建扩展 (Zephir and creating extensions)

Zephir is now in version 0.3, and can be used by the general public to write custom extensions for PHP. Zephir supports all the standard logical structures you’re used to (except “else if”), and lets you pre-declare variables by type to make it easier to compile into highly optimized C code. It’s important to note that Zephir is an ahead-of-time compilation language, meaning the compilation step might just make you less productive if you’re used to iterating and testing rapidly. The long term gains, however, are worth it.

Zephir现在的版本为0.3,可以被公众用来编写PHP的自定义扩展。 Zephir支持您习惯的所有标准逻辑结构(“ else if”除外),并允许您按类型预先声明变量,以使其更易于编译为高度优化的C代码。 需要特别注意的是Zephir是一种提前编译的语言,这意味着如果您习惯于快速迭代和测试,则编译步骤可能会使您的工作效率降低。 但是,长期的收益是值得的。

Zephir is memory-safe, meaning it has no pointers or manual memory management support. For such low level operations, one should stick with C. With regards to power, Zephir is thus weaker, but more user friendly than C. You can consider it a hybird of C and PHP, leaning more to the PHP side of things.

Zephir是内存安全的,这意味着它没有指针或手动内存管理支持。 对于这样的低级操作,应该坚持使用C。就功率而言,Zephir较弱,但比C更用户友好。您可以将其视为C和PHP的混合体,更多地倾向于PHP方面。

So what can I do with it? Always wanted to close-source your PHP app? Wondered how much faster a statistics calculation of your company’s backend would be if it were running in C? You can do all that and more now. First, check out this Vimeo screencast on making your first Zephir extension.

那我该怎么办呢? 一直想关闭您PHP应用程序的源代码? 想知道如果您的公司的后端运行在C语言中,那么进行后端统计的速度会快多少? 您现在可以做更多的事情。 首先,查看有关制作您的第一个Zephir扩展的Vimeo截屏视频。

Creating your first PHP extension with Zephir from Phalcon Framework on Vimeo.

从Vimeo上的Phalcon Framework 使用Zephir创建您的第一个PHP扩展 。

Next, follow through the tutorial, read the docs, and play around. If you end up making anything other than what the tutorials teach, we’d love to publish your step-by-step.

接下来,按照教程进行操作 ,阅读文档 ,然后进行练习。 如果您最终无法完成教程所教的内容,那么我们很乐意逐步发布您的内容。

An example Hello World class like this one:

像这样的Hello World类示例:

namespace   Test ;
/**
* This is a sample class
*/
class   Hello
{
/**
* This is a sample method
*/
public   function  say ()
{
echo  "Hello World!" ;
}
}

will compile down into this one:

将编译为以下内容:

#ifdef  HAVE_CONFIG_H
#include   "config.h"
#endif
#include   "php.h"
#include   "php_test.h"
#include   "test.h"
#include   "kernel/main.h"
/**
* This is a sample class
*/
ZEPHIR_INIT_CLASS ( Test_Hello )   {
ZEPHIR_REGISTER_CLASS ( Test ,   Hello ,  hello ,  test_hello_method_entry ,   0 );
return  SUCCESS ;
}
/**
* This is a sample method
*/
PHP_METHOD ( Test_Hello ,  say )   {
php_printf ( "%s" ,   "Hello World!" );
}

Note that Zephir requires you to use classes and namespaces – code without them is not allowed – this is to enforce good coding habits, proper object oriented code and solid encapsulation.

需要注意的是ZEPHIR需要您使用类和命名空间-没有他们的代码是不允许的-这是执行良好的编码习惯,适当的面向对象的代码和固体封装。

贡献 (Contributing)

You can contribute to the faster development and better test coverage of Phalcon 2.0 by installing as usual, only doing so from the 2.0.0. branch. Note that this will replace your current Phalcon installation – so only use it in development environments, preferably something like Vagrant boxes. For more details on pulling off a Phalcon install in a Vagrant VM, see this article.

通过照常安装(仅从2.0.0版本开始) ,您可以为Phalcon 2.0的更快开发和更好的测试覆盖率做出贡献。 分行 。 请注意,这将代替您当前的Phalcon安装-因此只能在开发环境中使用它,最好在Vagrant box之类的环境中使用。 有关在Vagrant VM中进行Phalcon安装的更多详细信息,请参阅本文 。

The full installation procedure is as follows:

完整的安装过程如下:

git clone http : //github.com/phalcon/cphalcon
git checkout  2.0 . 0
cd ext
sudo  ./ install - test

In any *nix environment, this just clones the usual repo, switches to the 2.0.0 branch, and then installs as usual. The API is, for the most part, identical to what it was, so transitioning shouldn’t be very difficult – and if you encounter any bugs, the Phalcon team encourages bug reports on the GitHub issues page, preferably followed by Unit Tests that demonstrate the bugs. For a good overview of contributing to an open source project on GitHub, please see here and here.

在任何* nix环境中,这仅克隆通常的存储库,切换到2.0.0分支,然后照常安装。 该API在很大程度上与原来的API相同,因此过渡并不难-如果您遇到任何错误,Phalcon团队会鼓励在GitHub问题页面上报告错误,最好在此之后进行单元测试,以证明错误。 有关在GitHub上为开源项目做出贡献的良好概述,请参见此处和此处 。

To further contribute to Phalcon effortlessly, consider upvoting this issue as well – it aims to have Phalcon installed on Google App Engine, as described here, and would produce the most powerful PHP environment to date, outperforming even HHVM.

为了进一步促进尔康费力 ,考虑upvoting 这个问题以及-它的目的是安装在谷歌App Engine的尔康,如所描述这里 ,并会产生最强大PHP环境,到目前为止,跑赢甚至HHVM 。

结论 (Conclusion)

Phalcon is moving ahead faster and better than anyone expected. We can expect to see the full stable release by Q2 2014 for sure, marking a year of Zephir’s development and Phalcon2’s announcement. The framework will probably be safe to use in production apps long before that.

Phalcon的发展比任何人所预期的更快,更好。 我们可以肯定会在2014年第二季度看到完全稳定的发布,这标志着Zephir的发展和Phalcon2的发布。 在此之前,该框架很可能可以安全地用于生产应用程序中。

If you’re experimenting with Phalcon 2 or Zephir, please give us a shout – we’d love to publish some tutorials you write. If you just have an idea, or have built something but feel like you don’t write well or your English is bad, get in touch nonetheless – we’ll find a way.

如果您正在尝试使用Phalcon 2或Zephir,请大声疾呼-我们很乐意发布您编写的一些教程。 如果您只是有一个主意,或者已经建立了一些东西,但是感觉自己写的不好或英语不好,请保持联系-我们会找到一种方法。

翻译自: https://www.sitepoint.com/phalcon-2-0-alpha-landing/

phalcon

phalcon_Phalcon 2.0 Alpha着陆相关推荐

  1. InfluxDB 2.0 Alpha展开测试!将会加入查询语言Flux

    InfluxData释出其开源时序数据库InfluxDB 2.0 Alpha测试版,这个版本最大的更新,便是增加了新的数据脚本和查询语言Flux,不只能提供跨平台时序数据操作,还能将TICK组件堆栈整 ...

  2. python3.9.0_Python 3.9.0 alpha 1 发布了,3.9 系列首个迭代版本

    Python 3.9.0 alpha 1 发布了,这是 3.8 之后的首个 3.9 系列版本. 官方没有介绍新特性,也没有添加新模块,但是以下模块有所改进: ast asyncio curses fc ...

  3. Cocos2d-JS v3.0 alpha

    Cocos2d-JS是整合了Cocos2d-html5 v3.0 alpha和Cocos2d-x JSBinding的新JS引擎仓库.整合之后的核心优势在于Html5和JSB的开发流程及API现在变得 ...

  4. php-7.1.0,PHP 7.4.0 Alpha 1 v7.4.0 官方最新版

    PHP团队近期宣布推出PHP 7.4.0首个版本PHP 7.4.0 Alpha 1,且下一个Alpha 2版本也在计划推出,不过作为早期测试版本,建议不要在生产环境中使用,想体验PHP最新运行逻辑的可 ...

  5. jboss7.0.2_红帽JBoss企业应用平台7.0 ALPHA发布了!

    jboss7.0.2 红帽JBoss企业应用程序平台7(JBoss EAP 7)是基于开放标准构建并符合Java Enterprise Edition 7规范的中间件平台. 它将WildFly App ...

  6. 红帽JBoss企业应用平台7.0 ALPHA发布了!

    红帽JBoss企业应用程序平台7(JBoss EAP 7)是基于开放标准构建并符合Java Enterprise Edition 7规范的中间件平台. 它将WildFly Application Se ...

  7. PostgreSQL 8.4.3 Final / 9.0 Alpha 4

    PostgreSQL 是一种对象-关系型数据库管理系统(ORDBMS),也是目前功能最强大.特性最丰富和最复杂的自由软件数据库系统.它起源于伯克利 (BSD)的数据库研 究计划,目前是最重要的开源数据 ...

  8. 京东:618 期间遭「黑公关」恶意抹黑;Adobe 回应“杀死Flash”;Bootstrap 5.0 Alpha 发布 |...

    整理 | 屠敏 头图 | CSDN 下载自东方 IC 快来收听极客头条音频版吧,智能播报由出门问问「魔音工坊」提供技术支持. 「极客头条」-- 技术人员的新闻圈! CSDN 的读者朋友们早上好哇,「极 ...

  9. 禅道 10.0.alpha 版本发布,全新的界面和交互体验

    禅道项目管理软件集产品管理.项目管理.质量管理.文档管理.组织管理和事务管理于一体,是一款功能完备的项目管理软件,完美地覆盖了项目管理的核心流程.禅道官网:http://www.zentao.net ...

最新文章

  1. 问价已损坏 文件服务器,由于检查点文件 (.chk) 丢失或已损坏,无法打开数据库...
  2. HDU6964 I love counting (字典树+莫队)
  3. spring配置文件中分别使用多个properties文件
  4. poj 1390(消除方块(blocks))
  5. python画tan_Python入门之三角函数tan()函数实例详解
  6. 使用async读取异步数据
  7. 002-Go通过ioutil 读写文件
  8. 剑指offer面试题30. 包含min函数的栈(辅助栈)
  9. linux iops 监控,企业级监控软件使用zabbix key 监控IOPS状态
  10. 没项目经验,这7个前端项目让你脱颖而出
  11. 贴上AI标签的综艺,未来的模样你敢想象吗?
  12. Market Research/ Desk Research免费二手数据渠道整理
  13. 德国AgBB VoC有害物质测试
  14. 与非门如何变成非门,与门,异或门
  15. 普适计算的六大必备条件
  16. rh2288v3服务器硬盘故障,RH2288H V3服务器出现0x02000007告警
  17. 如何用计算机二进制进行计算,计算机如何实现二进制数据运算
  18. 前端树形图(未完成完善,会持续更新)
  19. 毕业一年,程序猿工作一年总结,有收获,有失去,有遗憾,但仍一往无前
  20. Laravel 接受Ajax的POST请求

热门文章

  1. 解决跨域Cross origin requests are only supported for protocol schemes的其中一种种办法
  2. docker实现elasticsearch集群实战
  3. Uni-APP 原生App-云打包 Android 图文教程
  4. metro-Caching
  5. c4d支持mac系统渲染器有哪些_Corona4最新版下载 C4D实时交互渲染器Corona Renderer 4 for Cinema 4D R14-R21 Mac苹果电脑版 下载-脚本之家...
  6. 离散数学:连通分支数
  7. SolidWorks卸载重装教程
  8. matlab清空文件夹命令_matlab 中的删除文件
  9. 硬盘里充满回忆的老旧视频如何变得高清?以前拍摄的旧视频高清修复
  10. 露营“卖水人”,还能火多久?