简体   繁体   English

Php框架:symfony 1,symfony 2或Yii

[英]Php framework : symfony 1, symfony 2 or Yii

We are going to switch from an homemade framework to Symfony or Yii. 我们将从自制框架切换到Symfony或Yii。 The capabilities of these two framework are, from our point of view, similar (ie they both have what we need). 从我们的观点来看,这两个框架的能力是相似的(即它们都有我们需要的东西)。

Our situation : php 5.2.9, medium-size website (10.000 uniques / day) but shared hosting. 我们的情况:php 5.2.9,中型网站(10.000唯一身份/天)但共享主机。

  • Given the version of php that we have, we can't go for symfony 2 (it needs 5.3.4) so is it a smart move to go for symfony 1 now that the version 2 is out ? 鉴于我们拥有的php版本,我们不能选择symfony 2(它需要5.3.4)因此,现在版本2已经用完了,这是一个聪明的举动去symfony 1吗?
  • We are in shared hosting (going to a dedicated server is not an option for now, we don't have the money for it), won't symfony 1 and yii ask for too much ressources (I'm more worry about symfony 1, from what I've read) ? 我们在共享托管(去专用服务器现在不是一个选项,我们没有钱),不会symfony 1和yii要求太多的资源(我更担心symfony 1 ,从我读过的)?
  • Some of the websites contributors are not really experienced with php / MVC frameworks : once the structure of the website will be converted to one of these 2 frameworks, will there be difficulties for these contributors ? 一些网站贡献者并不熟悉php / MVC框架:一旦网站结构转换为这两个框架中的一个,这些贡献者会遇到困难吗? Spending 2-3 days to discover the framework is OK, 2-3 weeks is not. 花2-3天发现框架是可以的,2-3周不是。 I've read that yii has less tutorials (but complete documentation) than symfony but this last one is more difficult to understand. 我已经读过yii比symfony有更少的教程(但是完整的文档),但最后一个更难理解。

Please no answer like "this one is better", ideally someone that would have use the two frameworks recently. 请不要回答“这个更好”,最好是最近会使用这两个框架的人。

I'm extremely late to the game here, but it's kind of relevant because Symfony2 is actually stable and in use. 我在这里游戏的时间非常晚,但它有点相关,因为Symfony2实际上是稳定的并且在使用中。 I struggled to get Symfony2 working for a week and a half on a work dev box running CentOS 5.6 VPS (with a relatively locked down configuration, but I can sudo). 我努力让Symfony2在运行CentOS 5.6 VPS的工作开发盒上工作一周半(配置相对锁定,但我可以sudo)。

Then I quit because the "Agile Development with Yii" and "Yii Cookbook" I had ordered a few days earlier had arrived, and I thought to myself "nothing could be worse than this headache". 然后我退出了因为几天前订购的“敏捷开发与Yii”和“Yii Cookbook”已经到了,我心里想“没有比这更令人头疼的事情”。 Basically, there was all kinds of issues with git and Symfony's console depending on it (I think). 基本上,git和Symfony的控制台都有各种各样的问题(我认为)。 I was just trying to play. 我只是想玩。

Then I started playing with Yii. 然后我开始玩Yii。 I designed my db very carefully, checked out the extensions, including the bada$$ bootstrap extensions, and basically my entire app was done in about 48 hours, and it included a 10 table db, tons of data, and fairly complex user permissions, etc. 我非常仔细地设计了我的数据库,检查了扩展,包括bada $$ bootstrap扩展,基本上我的整个应用程序在大约48小时内完成,它包括10个表db,大量数据和相当复杂的用户权限,等等

Piece of cake. 小菜一碟。 I don't really see the advantage of Symfony2 other than the fact that it's going to be the backbone of Drupal 8, if that's the kind of thing you're into. 我没有真正看到Symfony2的优势,除了它将成为Drupal 8的骨干这一事实,如果那是你所进入的那种东西。 :) :)

Oh, and not only did Yii make it easy to build the app, it made it easy to make me look like a ROCKSTAR. 哦,Yii不仅可以轻松构建应用程序,还可以让我看起来像一个ROCKSTAR。 Total jQueryUI integration (in addition to Bootstrap - which is responsive by default, so I don't even have to worry about that crap). 总的jQueryUI集成(除了Bootstrap - 默认是响应,所以我甚至不用担心这个废话)。 All data is delivered through portlets and widgets that are super easy to use. 所有数据都通过易于使用的portlet和小部件提供。

I couldn't recommend Yii highly enough. 我不能足够推荐Yii。 It's the bomb. 这是炸弹。

symfony2 is not out yet. symfony2还没有出来。 it's no more preview but its still beta. 它不再是预览,但仍然是测试版。

to point 2; 到第2点; depends whats your limits in php (eg memory limit) symfony has by the way a nice caching strategy, so it shouldn't be a problem. 取决于你在php中的限制(例如内存限制)symfony有一个很好的缓存策略,所以它应该不是问题。

as you mentioned, theres no answer like "a or b is better". 如你所说,没有答案像“a或b更好”。 but you should check if you are able to run those frameworks on your shared host (sometimes its a bit bitchy to set up symfony on shared hosts). 但是你应该检查一下你是否能够在共享主机上运行这些框架(有时在共享主机上设置symfony有点麻烦)。

As i have not use Yii i cannot make a comparison there. 由于我没有使用Yii,我无法在那里进行比较。 However if you go for Symfony 1.xx now that S2 is out, which you cannot use because of the php version, there is a limited support life to be taken into account. 但是,如果您现在使用Symfony 1.xx,因为php版本不能使用S2,因此需要考虑有限的支持生命周期。 Sensio say November 2012 but support and fixes may well tail of as S2 gets more traction. Sensio说2012年11月,但支持和修复可能很好,因为S2获得了更大的牵引力。 It doesn't mean it will disappear of course but you need to weigh this factor into your decision making. 这并不意味着它会消失,但你需要将这个因素权衡到你的决策中。

Noting your requirements, a heads up that Symfony2 needs PHP 5.3.2. 注意到你的要求,Symfony2需要PHP 5.3.2。

http://symfony.com/blog/why-will-symfony-2-0-finally-use-php-5-3 http://symfony.com/blog/why-will-symfony-2-0-finally-use-php-5-3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM