phalcon和yaf_Google App Engine和Phalcon的Plea

  • Post author:
  • Post category:其他


phalcon和yaf

Let’s find out about Google’s recent embrace of PHP in Google App Engine, what it means for the PHP community, and how it can be improved even further if they add support for the high performing PHP framework Phalcon.

让我们了解一下Google最近在Google App Engine中采用PHP的情况,这对PHP社区意味着什么,以及如果他们增加了对高性能PHP框架Phalcon的支持,如何进一步改进它。

什么是Google App Engine?

(

What’s Google App Engine?

)


Google App Engine

(GAE) is Google’s cloud computing Platform as a Service offering on which users deploy web applications that live in Google’s data centers. This means any application we deploy in the environment automatically inherits the stability, interoperability, and scalability of applications such as Gmail, Google+, and more.


Google App Engine

(GAE)是Google的云计算平台即服务产品,用户可以在其上部署位于Google数据中心的Web应用程序。 这意味着我们在环境中部署的任何应用程序都会自动继承Gmail,Google +等应用程序的稳定性,互操作性和可伸缩性。

While a full discussion of GAE is outside the scope of this article, suffice it to say that GAE is neither a private server nor a virtual private server – it’s a platform. As such, it has some limitations. You cannot simply install extensions in it, nor can you write to disk freely. You cannot alter resource limits on your own and you cannot install custom system tools. It isn’t your average Linux box; it’s a fully managed colossal environment for enterprise-level applications.

尽管对GAE的完整讨论不在本文的讨论范围之内,但只需说一下GAE既不是私有服务器也不是虚拟私有服务器-它是一个平台就足够了。 因此,它具有一些局限性。 您不能简单地在其中安装扩展,也不能自由地写入磁盘。 您不能自行更改资源限制,也不能安装自定义系统工具。 这不是您的平均Linux机器; 这是用于企业级应用程序的完全托管的巨大环境。

GAE has been steadily rising in popularity over the past few years, especially for deployment of Python 2 and JVM language (Java, Scala, Clojure) applications, but only

recently at Google I/O

was it announced that PHP support was added due to

community interest

.

在过去的几年中,GAE的受欢迎程度一直在稳步上升,尤其是在部署Python 2和JVM语言(Java,Scala,Clojure)应用程序方面,但直到

最近Google I / O

才宣布由于

社区

原因增加了PHP支持

兴趣

GAE deployment is free up to a certain point. If your app exceeds the free usage quotas, you can request a paid upgrade. It’s a pay-as-you-use model which works best for large scale high-performance applications. As such, optimizing your application and reducing the number of requests is absolutely essential. Not only does it help performance, but it literally saves you money.

GAE部署在一定程度上是免费的。 如果您的应用超出免费使用配额,则可以请求付费升级。 这是一种按使用付费的模式,最适合大规模高性能应用程序。 因此,优化您的应用程序并减少请求数量是绝对必要的。 它不仅有助于提高性能,而且实际上可以为您节省金钱。

过渡到Google App Engine

(

Transitioning to Google App Engine

)

GAE’s filesystem is read-only. The only way to write something to disk (such as file uploads, cache, custom logs, etc.) is to either use an external service like a read-write CDN or use a virtual filesystem like as gae-filestore (more information is available in the Google I/O video linked above and

here

) or

Google Cloud Storage

. Furthermore, there is no such thing as a local install of MySQL/MariaDB or PostgreSQL. Instead, you have the option of using

Google Cloud SQL

(which is similar to MySQL but with

limitations

and differences we won’t be covering here).

GAE的文件系统是只读的。 将某些内容写入磁盘的唯一方法(例如文件上传,缓存,自定义日志等)是使用外部服务(例如读写CDN)或使用虚拟文件系统(例如gae-filestore)(更多信息可用)在上方和

此处

链接的Google I / O视频中)或

Google Cloud Storage中

。 此外,没有在本地安装MySQL / MariaDB或PostgreSQL这样的东西。 取而代之的是,您可以选择使用

Google Cloud SQL

(与MySQL相似,但有

局限性

和差异性,我们将不在此处介绍)。

Needless to say, the PHP developer transitioning to a GAE environment has his work cut out for him. Thankfully the Google PHP team

runs a blog

(which is actually a WordPress installation on GAE) with helpful hints and tutorials, and the

documentation

for the still experimental PHP implementation is well done. For those interested in a simple overview, there’s also the quite clear

Getting Started Guide

.

不用说,向GAE环境过渡PHP开发人员已经为他完成了工作。 幸运的是,Google PHP团队

运行了一个博客

(实际上是GAE上的WordPress安装),其中包含有用的提示和教程,并且仍在试验性PHP实现的

文档

做得很好。 对于那些对简单概述感兴趣的人,还有非常清晰的《

入门指南》

I encourage you to check out all the linked resources to get as acquainted as much as possible with this new environment. GAE’s endorsement of PHP is a huge shift in the PHP community, and definitely has the potential to impact PHP development in the long run.

我鼓励您检查所有链接的资源,以尽可能多地了解这个新环境。 GAE对PHP的认可是PHP社区的一次巨大转变,从长远来看,绝对有可能影响PHP开发。

基本PHP扩展和Phalcon

(

Essential PHP Extensions and Phalcon

)

People have already noted the huge downside of not being able to install extensions and have requested the addition of two essential ones:

mbstring

and

iconv

(which have since been installed), making GAE’s PHP runtime that much more usable. Seeing as how PHP support is still experimental and not ready for production, the GAE team is accepting and actively looking over suggestions for new installations and upgrades.

人们已经注意到无法安装扩展程序的巨大弊端,并要求添加两个必不可少的扩展程序:

mbstring



iconv

(此后已安装),从而使GAEPHP运行时更加有用。 看到PHP支持仍处于试验阶段且尚未投入生产,GAE团队正在接受并积极寻找有关新安装和升级的建议。

This is where

Phalcon

comes into play. Phalcon is a highly advanced PHP framework written in C and installed as a PHP extension. It offers all of the framework features you’re used to and much more, but with far greater performance (more speed, fewer resources) and robustness. Written in C, it executes natively and is loaded into memory when your server starts up, essentially enhancing PHP itself with some much needed missing features.

这就是

Phalcon

发挥作用的地方。 Phalcon是一个高级高级PHP框架,用C编写,并作为PHP扩展安装。 它提供了您习惯使用的所有框架功能以及更多功能,但具有更高的性能(更快的速度,更少的资源)和鲁棒性。 它使用C语言编写,可本地执行,并在服务器启动时加载到内存中,从而通过一些急需的缺少功能来增强PHP本身。

Phalcon is more PHP6 than PHP6 in itself in some ways, and enables you to write fast and secure applications in a fraction of the time it took to build them before. If you haven’t tried Phalcon out yet, I encourage you to do so – their

documentation

is very complete and thorough with examples for every API call.

在某些方面,Phalcon本身比PHP6本身更像PHP6,它使您能够以以前构建它们所需时间的一小部分来编写快速而安全的应用程序。 如果您还没有尝试过Phalcon,我建议您这样做-他们的

文档

非常完整且详尽,其中包含每个API调用的示例。

The problem is the aforementioned inability to install custom extensions into GAE’s PHP, which means Phalcon is permanently unavailable to such environments. Due to Phalcon’s

excellent


performance

f, it would be a shame if it weren’t implemented since it would undoubtedly reduce both Google’s server load and the cost app owners would be faced with. This is why I’ve

opened a new feature request

in GAE’s issue tracker which you can vote for. So far, it’s among the top 30 requested features.

问题是上述无法将自定义扩展安装到GAEPHP中,这意味着Phalcon在此类环境中永久不可用。 由于Phalcon的

出色


性能

f,如果不加以实施将是一个遗憾,因为它无疑会减少Google的服务器负载和应用程序所有者所面临的成本。 这就是为什么我在GAE的问题跟踪器中

打开了一个新功能请求

的原因,您可以对此进行投票。 到目前为止,它是前30个要求的功能之一。

Don’t take my word for it though – try out Phalcon and see how you like it. Chances are you’ll be voting for the issue moments later. Please vote exclusively by starring, however – not by commenting. Comments are there purely for the purpose of helping out with information and potential issues during installation. When a comment is made on Google Code, an email is sent to all people who starred the issue, which might result in some people un-starring if they feel like they’re being spammed ultimately hurting the effort.

不过,请不要相信我的话–试试Phalcon,看看您的喜好如何。 您稍后可能会投票给该问题。 请仅以主演形式投票,而不是发表评论。 注释纯粹是为了在安装过程中提供信息和潜在问题方面的帮助。 在对Google Code进行评论时,会向所有对该问题加注星标的人发送一封电子邮件,这可能会导致某些人如果觉得自己被发送垃圾邮件最终损害了工作量,则可以取消加注星标。

摘要

(

Summary

)

GAE is a brand new opportunity for PHP. It has the potential to revolutionize the world of PHP development and the hosting options available to developers. To be part of this new age from the get-go, stay tuned for PHP-GAE tutorials and Phalcon guides on SitePoint and follow the situations as they develop via the links in this article, in particular

gaeforphp-blog.appspot.com

. And don’t forget to check out Phalcon and vote for the issue to further the cause, and feel free to shoot me any questions via

Google+

or in the comments below.

GAE是PHP的全新机遇。 它具有改变PHP开发世界以及开发人员可用的托管选项的潜力。 要成为起步的新时代的一部分,请继续关注SitePoint上PHP-GAE教程和Phalcon指南,并通过本文中的链接(尤其是

gaeforphp-blog.appspot.com)

关注它们的发展情况。 而且,不要忘记查看Phalcon并为进一步推动该问题的投票进行表决,并随时通过

Google+

或以下评论向我提出任何问题。

翻译自:

https://www.sitepoint.com/google-app-engine-and-a-plea-for-phalcon/

phalcon和yaf