用于社交网络的 PHP 框架

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3380519/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 09:32:21  来源:igfitidea点击:

PHP framework for Social Networking

phpframeworkssocial-networking

提问by goddamnyouryan

I'm an intermediate PHP developer with no experience building a large scale web application in this language (though I have in others, mainly Rails)...say I wanted to build a social networking site using PHP and MYSQL (preferably) with all the web 2.0 trimmings.

我是一名中级 PHP 开发人员,没有用这种语言构建大型 Web 应用程序的经验(尽管我有其他语言,主要是 Rails)……说我想使用 PHP 和 MYSQL(最好)构建一个社交网站Web 2.0 装饰。

Where should I start? What sort of frameworks should I be looking at? Any up to date modern books that would outline something like this? Really anything for building a modern web app in PHP.

我应该从哪里开始?我应该关注什么样的框架?任何最新的现代书籍都会概述这样的事情?真的可以用 PHP 构建现代 Web 应用程序。

采纳答案by Paul Dragoonis

Ryan, there is a php framework called Elggwhich is a php framework directed at social networking based applications.

Ryan,有一个名为Elgg的 php 框架,它是一个针对基于社交网络的应用程序的 php 框架。

回答by Sarfraz

回答by Bug Magnet

I suggest you have a look at the Yii Framework. It is very well-designed and was written with performance in mind. They've heavily focused on optimising their code for use in combination with an opcode cache like APC - no other framework has shown the same level of performance improvementwhen used with APC. Outside of performance, the framework also offers lots of built-in support for security (secure sessions with HMAC, SQL injection prevention, XSS prevention, etc.), forms, user input validation, caching, authentication/access control, and JQuery integration.

我建议你看看Yii 框架。它的设计非常好,并且在编写时考虑了性能。他们非常专注于优化他们的代码,以便与 APC 等操作码缓存结合使用——当与 APC 一起使用时,没有其他框架显示出相同水平的性能改进。除了性能之外,该框架还为安全性(使用 HMAC 的安全会话、SQL 注入防护、XSS 防护等)、表单、用户输入验证、缓存、身份验证/访问控制和 JQuery 集成提供了大量内置支持。

If you're an intermediate PHP programmer who is not experienced/confident enough to build your own framework, then Yii is a really good place to start as the code is very elegant and imho the programmer made some great design choices while writing the framework - simply reading through the Yii code makes for a great way to learn about how to design/write good PHP code.

如果你是一个中级 PHP 程序员,没有足够的经验/信心来构建自己的框架,那么 Yii 是一个非常好的起点,因为代码非常优雅,而且程序员在编写框架时做出了一些很棒的设计选择 -简单地阅读 Yii 代码是学习如何设计/编写好的 PHP 代码的好方法。

Just my two cents...

只是我的两分钱...

回答by umop

Wikipedia has a comparison of various social network frameworks / software:

维基百科有各种社交网络框架/软件的对比:

http://en.wikipedia.org/wiki/Comparison_of_social_networking_software

http://en.wikipedia.org/wiki/Comparison_of_social_networking_software

Several of them use PHP / MySQL.

其中一些使用 PHP/MySQL。

I also saw this book on creating a social network in PHP:

我还看到了这本关于用 PHP 创建社交网络的书:

Create a powerful and dynamic Social Networking website in PHP

用 PHP 创建一个强大而动态的社交网站

回答by Gabe Evans

People Podsmay be what you're looking for. It's a PHP framework built with social networking in mind.

People Pods可能正是您要找的。它是一个考虑到社交网络而构建的 PHP 框架。

回答by Stephen Fuhry

I'm actually doing this right now currently with Zend Framework, and it is working out fantastically well.. Zend is seriously powerful and scalable.

我现在实际上正在使用 Zend Framework 做这件事,而且效果非常好.. Zend 非常强大且可扩展。

I've always hated doing all the initial work of creating login accounts and hashing passwords and putting stuff in place to manage SESSIONS, so moving forward with new work I plan on checking out an early revision of this project and simply forking it into whatever other site that requires logins.

我一直讨厌做所有的初始工作,比如创建登录帐户和散列密码,并把东西放在适当的位置来管理 SESSIONS,所以继续进行新的工作,我计划检查这个项目的早期版本,然后简单地将它分叉到其他任何地方需要登录的网站。

回答by Charles

What sort of frameworks should I be looking at?

我应该关注什么样的框架?

Try a modern framework like Kohanaor maybe something more engineered-OO like Zend Framework.

尝试像Kohana这样的现代框架或者像Zend Framework这样更具工程化的面向对象的框架

You also might want to consider a simple procedural frameworkinstead of an OO framework. PHP does very, very well working at low levels.

您可能还想考虑一个简单的过程框架而不是 OO 框架。PHP 在低级别上做得非常非常好。

Avoid Cake. It tries to be Rails-like, but not only do Rails idioms translate very poorly into PHP, Cake is stuck in the design era of PHP4.

避免蛋糕。它试图像 Rails 一样,但不仅 Rails 习语在 PHP 中的转换非常糟糕,Cake 还停留在 PHP4 的设计时代。

回答by dicroce

I think the place to start is to really understand the fundamentals of HTTP and the tools PHP gives you for dealing with its stateless nature.

我认为首先要真正了解 HTTP 的基础知识以及 PHP 为您提供的用于处理其无状态性质的工具。

Beyond that, I would look into templating. Perhaps Smarty?

除此之外,我会研究模板。也许Smarty?

Finally, all of the normal MVC design patterns stuff apply equally to PHP, and there are lots of implementations if you'd like to use something off the shelf. You might want to check out Cake, if you need a framework.

最后,所有正常的 MVC 设计模式都同样适用于 PHP,如果您想使用现成的东西,有很多实现。如果您需要一个框架,您可能想查看Cake