php框架和不用框架_2014年最佳PHP框架

php框架和不用框架

Update: If you’d like to take part in the next high-yield survey from SitePoint, please vote for your favorite IDE here. The aim of the survey is to gauge the PHP community, and to find the most popular IDE in use today, by gender, location, skill level, and more.

更新:如果您想参加SitePoint的下一次高收益调查,请在此处为您最喜欢的IDE投票。 这项调查的目的是评估PHP社区,并找到按性别,位置,技能水平及其他因素使用的当今最受欢迎的IDE。

The end of the year is upon us. Lots has changed in the PHP world in the past 365 days, and the PHP framework scene is more densely populated than ever. Everyone and their dog seems to have an idea of what a good framework should look like, but in the end, do we even know which frameworks actually end up being used in production projects? How many go beyond the stage of thousands of people just doing a demo app in them?

年底将至。 在过去的365天中,PHP世界发生了许多变化,并且PHP框架的场景比以往任何时候都更加密集。 每个人和他们的狗似乎都对一个好的框架应该是什么样子有所了解,但是最后,我们什至不知道最终在生产项目中使用了哪些框架? 有多少人超越了数千人仅在其中进行演示应用程序的阶段?

In a small survey we've held open for the past week or so (which has also been mentioned in PHP Weekly), we asked these questions to decide which frameworks deserve our attention in 2014 the most. The prerequisite for participation was merely having experience in more than one framework, seeing as it's pointless to ask someone what their favorite bar was if they've only drunk in one place.

在过去一周左右的时间里进行的一次小型调查(在PHP Weekly中也提到过)中,我们问了这些问题,以确定哪些框架最值得我们在2014年关注。 参与的前提条件是仅具有一个以上框架的经验,并认为询问某人他们最喜欢的酒吧是否只是在一个地方喝酒是毫无意义的。

Unfortunately, a big percentage of the answers had to be discarded due to people either refusing the notion that WordPress and similar suites aren't frameworks, or simply due to a blatant disregard of instructions – many responses were written by people who only ever worked in one framework. While their enthusiasm for this framework of choice is noteworthy and admirable, the final result which may end up being skewed by such approaches could hardly be called objective.

不幸的是,由于人们要么拒绝认为WordPress和类似套件不是框架的观点,要么仅仅是由于公然无视指令而放弃了很大一部分答案,许多答案都是由曾经从事过一个框架。 尽管他们对这种选择框架的热情是值得注意和令人钦佩的,但最终可能因这种方法而歪曲的最终结果很难被称为客观的。

结果汇总 (Results summary)

After discarding the invalid responses, and manually verifying every participant, we were left with the following data:

丢弃无效响应并手动验证每个参与者后,我们得到了以下数据:

chart

According to the results, the most promising frameworks for 2014 seem to be:

根据结果​​, 2014年最有前途的框架似乎是:

  • Laravel

    Laravel
  • Phalcon

    hal
  • Symfony2

    Symfony2

Yii and CodeIgniter seem to be sharing 4th place.

Yii和CodeIgniter似乎共享第四名。

After weeding out the obvious spam, the Laravel results had to be filtered the most, by far. Over half the people who voted for Laravel had zero proof of proficiency, or experience only with Laravel, and had to be discarded – despite this, it still prevailed.

在清除明显的垃圾邮件之后,到目前为止,必须对Laravel结果进行最多的过滤。 投票赞成Laravel的人中,有超过半数的人证明自己的熟练程度为零,或者只有Laravel的经验,因此不得不放弃-尽管如此,它仍然占了上风。

When looking at the answers, on average, the Laravel community seems to mostly favor the ease of entry – virtually no learning curve. Whether that's good or bad is a discussion for another time, seeing as we ended up in this "PHP is bad" mess mostly due to a horde of newbies considering it an easy to enter market, but the excellent documentation, large scale community support and speed of development definitely work in its favor. Another frequently mentioned advantage seems to be an active and impressively alive IRC channel where help is given instantly.

平均而言,在查看答案时,Laravel社区似乎大多数都倾向于轻松入门-几乎没有学习曲线。 不管是好是坏,这是另外一次讨论,因为我们最终陷入了“ PHP不好”的局面,这主要是由于成群的新手认为它很容易进入市场,但是出色的文档,大规模的社区支持以及发展速度肯定对它有利。 另一个经常被提及的优势似乎是活跃且令人印象深刻的IRC频道,可立即提供帮助。

An interesting misconception seems to be that Laravel is responsible for Composer. Many voters, both discarded and valid ones, mention Composer as the main advantage of Laravel, alongside Eloquent ORM and the Blade template engine, which is downright odd seeing as Composer is a package manager completely oblivious to the framework it's being used with, if any. For more information, I urge the participants in question to read some of our Composer articles, like this one. Despite all this, having only tried Laravel in demo projects, the results of this survey have piqued my interest enough to build my next production project in it, powered by HHVM.

一个有趣的误解似乎是Laravel负责Composer。 许多选民,无论是被抛弃的还是合法的选民,都将Composer视为Laravel的主要优势,再加上雄辩的ORM和Blade模板引擎,这实在令人奇怪,因为Composer是一个完全忽略了与之配合使用的框架的软件包管理器(如果有) 。 有关更多信息,我敦促有问题的参与者阅读我们的Composer文章,例如这篇文章。 尽管如此,仅在演示项目中尝试过Laravel,这项调查的结果激发了我的兴趣,足以在其中建立我的下一个由HHVM驱动的生产项目。

Phalcon's main advantage was performance over other frameworks and the fact that the framework is such a rounded up package (ORM, template engine, PHQL and more – all in one – little to no need for third party libs, meaning everything stays in-memory, C-based and super fast). Some of the respondents noted the fact that it's installed as an extension as an advantage, because the process of installation weeds out the hobbyists from the serious developers, a notion I personally tend to agree with. When mentioning cons, Phalcon's biggest one was also its biggest advantage – being written in C, it's nigh impossible to check under the hood.

Phalcon的主要优势是相对于其他框架的性能,并且该框架是一个经过整理的软件包(ORM,模板引擎,PHQL等,所有这些合而为一),几乎不需要第三方库,这意味着所有内容都保留在内存中,基于C且超快速)。 一些受访者指出,将其安装为扩展是一项优势,因为安装过程会淘汰那些认真的开发人员的爱好者,我个人倾向于同意这一观点。 当提到缺点时,Phalcon的最大优点也是最大的优点-用C语言编写,几乎不可能在后台进行检查。

Symfony2 is touted as the most modular and extensible of the bunch, and the most feature complete, mainly due to containing Doctrine2. Its voters, however, do seem able to admit that it's quite bloated and slow at times due to this feature-richness.

Symfony2被认为是模块化程度最高,可扩展性最强,功能最完整的,主要是因为它包含了Doctrine2。 但是,由于其功能丰富,其选民似乎确实能够承认它有些and肿且缓慢。

Interestingly, two ZF1 answers said they're stuck on said framework because of the work situation – their team or CTO refuses to switch to something more modern.

有趣的是,有两个ZF1答案表示由于工作情况而被困在上述框架中–他们的团队或CTO拒绝改用更现代的产品。

值得注意的答案 (Noteworthy answers)

Among the valid answers, here are some detailed enough to warrant a repost:

在有效答案中,以下是一些足够详细的内容,可以重新发布:

navarr says:

Navarr说:

Yii's built in ActiveRecord and migration systems make version control of the database easy and development using objects quick and painless. It takes a small amount of time to learn but become super simple afterwards – becoming worth it's namesake "Yii" – Chinese for "easy"

Yii内置的ActiveRecord和迁移系统使对数据库的版本控制变得容易,并且使用对象进行开发变得轻松快捷。 它需要少量的时间来学习,但是之后变得非常简单-值得将其命名为“ Yii”-中文为“易”

@amitgupta says:

@amitgupta说:

I've used CodeIgniter for years but eventually came a point where it didn't offer what I needed. I needed a somewhat full stack framework (so micro frameworks like Slim, Silex were out) with little or no learning curve (just like CI), which had a neat & clean intuitive API, solid code written on proven design patterns, which didn't bind me in one mindset, which was fast and had good documentation, which allowed TDD without fuss and which had a good community & resources available. Also one which allowed me to take a peek under the hood easily so I can see what goes on where (which ruled Phalcon out since its source is in C). Laravel & Symfony came very close but I eventually went with Laravel as I liked how it did things more.

我已经使用CodeIgniter多年,但最终出现了一点点,它没有提供我所需要的东西。 我需要一个稍微完整的堆栈框架(因此,像Slim,Silex这样的微框架就淘汰了),几乎没有学习曲线(就像CI一样),它有一个简洁整洁的直观API,用经过验证的设计模式编写的扎实代码,没有我将自己的思想束缚在心上,这是快速的并且具有良好的文档记录,这使TDD不必大惊小怪,并且拥有良好的社区和可用资源。 另外,它还使我可以轻松地在内部进行窥视,因此我可以看到在哪里发生了什么(由于Phalcon的源代码位于C中,因此将其排除在外)。 Laravel和Symfony的关系非常接近,但是我最终选择了Laravel,因为我喜欢它的功能。

panique doesn't use any of the listed ones, and says:

panique不使用任何列出的内容,并说:

Most frameworks are simply too advanced, making it hard for non-professional developers or frontend people to quickly build good things, so I was always searching for a naked and totally stripped-down PHP barebone application. php-mvc solves this problem and reduces the learning curve to a total time of under 30 minutes while still being very professional and self-explaining.

大多数框架都太先进了,这使得非专业的开发人员或前端人员很难快速构建好东西,因此我一直在寻找一个裸露且完全精简PHP准系统应用程序。 php-mvc解决了这个问题,并将学习时间缩短到30分钟以内,同时仍然非常专业和自我解释。

+Jream says this about Phalcon:

杰瑞姆 ( Jream)谈到了有关Phalcon的内容:

Provides all the core components I need to get going fast, beautiful ORM. It's feature rich, insanely fast, and has amazing documentation.

提供了快速开始使用所需的所有核心组件,漂亮的ORM。 它功能丰富,速度极快,并且具有惊人的文档。

Chris Thompson proves that exposure and name mean much in the PHP world by saying this about his choice of ZF2:

克里斯·汤普森(Chris Thompson)通过选择ZF2证明了曝光和名字在PHP世界中的意义。

I was already familiar with ZF1 from a previous project. ZF2 seemed the most logical one to use for our next project. We didn't have any experience with or exposure to most of the other frameworks. Ones that we were aware of had less documentation, examples, and online help (stackoverflow) than ZF2.

我已经对上一个项目的ZF1很熟悉。 ZF2似乎是我们下一个项目使用的最合逻辑的工具。 我们没有使用大多数其他框架的经验或经验。 我们知道的文档,示例和在线帮助(stackoverflow)少于ZF2。

Peter Nijssen explains:

彼得·尼森(Peter Nijssen)解释:

Been working with CodeIgniter for 4 years. Always suited me well and I wrote some sparks for it. Always has been a nice quick framework to start with. Easy to use. Since CodeIgniter was not on going anymore, while PHP made some major steps, I came in touch with Laravel. Immediately fell in love with it and still love it to this date. A framework which works excellent and is very developer-friendly. In my daily job, we are migrating everything from CodeIgniter to Symfony. In my personal life I would pick Laravel, while in professional life I would pick symfony. Laravel is more developer friendly and makes it a breeze to develop against. Symfony gives me currently more trust in the fact that they have been proven themselves already for years. Of course, both contain their similarities by Laravel who is using Symfony parts.

与CodeIgniter一起工作了4年。 总是很适合我,我为此写了一些火花。 一直以来都是一个不错的快速框架。 易于使用。 由于CodeIgniter不再进行,而PHP迈出了重要的一步,所以我联系了Laravel。 立即爱上它,至今仍爱着它。 一个出色的框架,对开发人员非常友好。 在我的日常工作中,我们正在将所有内容从CodeIgniter迁移到Symfony。 在我的个人生活中,我会选择Laravel,而在职业生活中,我会选择symfony。 Laravel对开发人员更友好,使开发变得轻而易举。 目前,Symfony使我更加相信以下事实:它们已经被证明了很多年。 当然,两者都包含使用Symfony部件的Laravel的相似之处。

Thiago Colares chooses TYPO3 Flow:

Thiago Colares选择TYPO3 Flow:

Architecture-ready for domain driven design. Dependency injection. Uses the Doctrine 2 ORM. Advanced template engine (Fluid). Strong, active, very skilled and helpful community

适用于域驱动设计的架构就绪。 依赖注入。 使用Doctrine 2 ORM。 高级模板引擎(流体)。 强大,活跃,非常熟练和乐于助人的社区

Rob Keplin says this about Phalcon:

罗伯·开普林 ( Rob Keplin )关于Phalcon的话:

It takes advantage of other popular framework's features such as event management, an easy to use ORM, all while promoting DI and taking advantage of newer PHP features like native namespaces. Since it is built as an extension, the framework has very little overhead. Not to mention the documentation makes for an easy learning curve. The only drawback is portability and I'm not able to dig through the library code while developing. But I'm really excited to see it grow and become more popular.

它充分利用了其他流行框架的功能,例如事件管理,易于使用的ORM,同时还提升了DI并利用了诸如本地名称空间之类的新PHP功能。 由于它是作为扩展构建的,因此该框架的开销很小。 更不用说文档了,学习曲线很容易。 唯一的缺点是可移植性,并且在开发时无法浏览库代码。 但是我很高兴看到它成长并变得越来越流行。

… and Sean M adds

…和肖恩·M补充

Phalcon makes it easy to design modern web application correctly, and makes it hard to design them incorrectly. Using direct injection, it is trivially easy to create software that tests fully end-to-end. An ORM that makes sensible default choices and is hugely extensible and configurable, multiple caching strategies, and built-in DB libraries for tons of helpers to allow for easy horizontal scalability. Add in the huge speed gains and trivial memory usage realized by using a shared-library written in C for all your requests, and you get a stack that is a true pleasure to work with and an absolute workhorse in production.

Phalcon使得正确设计现代Web应用程序变得容易,并且难以正确设计它们。 使用直接注入,可以轻松创建完全端到端测试的软件。 一个ORM,它做出明智的默认选择,并且具有极大的可扩展性和可配置性,多种缓存策略以及用于大量帮助程序的内置数据库库,以实现轻松的水平可扩展性。 通过使用C语言编写的共享库满足所有请求,可实现巨大的速度提升和琐碎的内存使用,您将获得一个真正令人愉悦的堆栈,并且是生产中的绝对主力。

@DwightConrad about Laravel:

@DwightConrad约Laravel:

Laravel uses the solid, tested components of the Symfony framework along with other popular packages to provide a modern framework that provides easy conventions, utilises modern programming patterns and makes development a breeze. It is refreshing to see PHP used as a modern programming language with a framework that takes hints from some of the big names outside of the PHP community.

Laravel使用Symfony框架经过测试的可靠组件以及其他流行的软件包,提供了一个提供简单约定,利用现代编程模式并使开发变得轻而易举的现代框架。 令人振奋的是,将PHP用作一种现代编程语言,其框架从PHP社区之外的一些知名人士那里获得了提示。

Stanlemon favors Symfony2:

Stanlemon赞成Symfony2:

Architecturally I prefer Symfony 2. I think it's attempt at componentization is admirable and the overall approach of bundles is brilliant. At times it can feel bloated and still at other times I wish it were more opinionated, but all in all it represents the only full stack framework that just lets me get things done the way that I want to. The use of Doctrine 2, Twig and Monolog and a powerful approach to functional testing is only further encouragement to use it.

在架构上,我更喜欢Symfony2。我认为它在组件化方面的尝试令人钦佩,并且bundle的整体方法非常出色。 有时它可能会感到肿胀,而在其他时候,我希望它会显得自以为是,但总而言之,它代表了唯一的完整堆栈框架,它可以让我按照自己的方式完成工作。 教义2,Twig和Monolog的使用以及功能测试的强大方法只是进一步鼓励使用它。

编辑选择 (Editor's choice)

It's no secret I'm a fan of Phalcon. I've used Zend 1 and 2 in large scale enterprise projects for years, and I did my time with CodeIginter. After testing (no commercial experience) all the frameworks in the list, I came to the conclusion that, deep down, they're all incredibly similar (except for Zend, which just stands out like a sore thumb). It was upon that realization that I redirected all my focus on the performance/robustness ratio instead, and found Phalcon. Phalcon has been sufficiently covered in previous articles – suffice it to say that having such a blazing fast framework pre-loaded in memory does wonders for your cloud bills (whether you use AWS, Azure or any others – the instance hours are delightfully shaved off – more on that in a future article).

我是Phalcon的粉丝,这已不是什么秘密。 我已经在大型企业项目中使用Zend 1和2多年了,我在CodeIginter上度过了自己的时间。 经过测试(没有任何商业经验)列表中的所有框架,我得出的结论是,从根本上讲,它们都非常相似(Zend除外,Zend就像是一个痛苦的拇指)。 正是基于这一认识,我将所有精力都转移到了性能/稳健性上,并找到了Phalcon。 Phalcon已在之前的文章中进行了充分介绍-足以说预先在内存中预装了如此出色的快速框架确实为您的云账单带来了奇迹(无论您是使用AWS,Azure还是任何其他平台-实例时间都可以节省)在以后的文章中有更多介绍)。

The fact that it's harder to install than the others (and nigh impossible on shared environments) also makes sure the community is a hardcore one, filled to the brim with people who are genuinely interested in it enough to not get bogged down by the basics. This means a tighter-knit group, but far more knowledgeable.

它的安装比其他安装更加困难(在共享环境中几乎不可能),这也确保了该社区是一个核心社区,对真正对其感兴趣的人们对此充满了热情,以至于不被基础所困扰。 这意味着组织更紧密,但是知识更丰富。

结论 (Conclusion)

So which framework seems most promising for 2014? Which should you switch to in the new year? Is it worth it? That's entirely up to you – as always, it depends on your comfort level, the project requirements, and time you have to study new things.

那么,哪种框架在2014年似乎最有前途? 在新的一年中您应该切换到哪个? 这值得么? 这完全取决于您–一如既往,这取决于您的舒适度,项目要求以及学习新事物的时间。

The only wrong choice is constraining yourself to only a single framework. Diversify, experiment, contribute. Step out of your comfort zone and try something new – there's no other way to grow. Perhaps next year, you'll vote differently!

唯一错误的选择是将自己限制在一个框架内。 多元化,实验,贡献。 走出舒适区并尝试一些新的东西–没有其他方法可以成长。 也许明年,您的投票方式会有所不同!

I want to personally thank you for participating in the survey, and being our readers. We hope to bring you increasingly more awesome articles in 2014, and look forward to sharing the knowledge of our amazing authors with you. The entire team here at SitePoint wishes you a Happy New Year and jolly holidays! See you over the hump!

我要亲自感谢您参与调查并成为我们的读者。 我们希望在2014年为您带来越来越多的精彩文章,并期待与您分享我们杰出作者的知识。 SitePoint的整个团队祝您新年快乐,节日快乐! 驼峰见!

Interested in taking your PHP skills to the next level? Learnable memberships come with unlimited access to SitePoint books and courses, covering PHP topics from MySQL to object-oriented programming.

有兴趣将您PHP技能提高到一个新的水平吗? 易学的会员资格可无限访问SitePoint书籍和课程,涵盖从MySQL到面向对象编程的PHP主题

翻译自: https://www.sitepoint.com/best-php-frameworks-2014/

php框架和不用框架

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值