开发者

PHP framework for Social Networking [closed]

As it currently stands, this question is not a good fit for our Q&A format.开发者_如何学Python We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago.

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.


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


A whole list of them:

  • Top 40 Free Open Source Social Networking Software


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


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


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.


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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜