用于社交网络的 PHP 框架

发布于 2024-09-11 23:39:50 字数 186 浏览 3 评论 0 原文

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

我应该从哪里开始?我应该考虑什么样的框架?有什么最新的现代书籍可以概述类似的内容吗?确实可以用 PHP 构建现代 Web 应用程序。

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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

旧城空念 2024-09-18 23:39:50

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

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

浪菊怪哟 2024-09-18 23:39:50

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

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

只是我的两分钱...

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 improvement when 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.

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.

Just my two cents...

习ぎ惯性依靠 2024-09-18 23:39:50

维基百科对各种社交网络框架/软件进行了比较:

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

其中一些使用 PHP / MySQL。

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

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

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

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

Several of them use PHP / MySQL.

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

Create a powerful and dynamic Social Networking website in PHP

暮凉 2024-09-18 23:39:50

我应该考虑什么样的框架?

尝试像 Kohana 这样的现代框架,或者像 Zend 框架

您可能还需要考虑一个简单的过程框架而不是面向对象框架。 PHP 在低级别上工作得非常非常好。

避免蛋糕。它试图变得像 Rails 一样,但不仅 Rails 习惯用法很难翻译成 PHP,而且 Cake 还停留在 PHP4 的设计时代。

What sort of frameworks should I be looking at?

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

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

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.

孤者何惧 2024-09-18 23:39:50

人物 Pod 可能就是您要找的。它是一个专为社交网络而构建的 PHP 框架。

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

云之铃。 2024-09-18 23:39:50

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

我一直讨厌创建登录帐户和散列密码以及将东西放在适当的位置来管理会话的所有初始工作,因此继续进行新工作我计划检查该项目的早期修订版并简单地将其分叉到其他任何项目中需要登录的网站。

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

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.

薯片软お妹 2024-09-18 23:39:50

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

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

最后,所有普通的 MVC 设计模式同样适用于 PHP,并且有很多如果您想使用现成的东西,请执行以下操作。如果您需要一个框架,您可能需要查看 Cake

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.

Beyond that, I would look into templating. Perhaps 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文