是否有任何 PHP *网站* 提供了其源代码?

发布于 2024-09-24 12:47:26 字数 1539 浏览 4 评论 0原文

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

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

发布评论

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

评论(10

贪恋 2024-10-01 12:47:26

下面是一个很好的网站,也提供了其源代码(从 Zend Framework 的角度来看,该网站的注释非常好,易于遵循/理解)

http://www.dasprids.de/

来源说明/信息
http://www.dasprids.de/behind-the-site

实际来源
http://site.svn.dasprids.de/

Below is a good site that also make its source available (which is very well commented and easy to follow/understand, from a Zend Framework standpoint)

http://www.dasprids.de/

Instructions/info for the source
http://www.dasprids.de/behind-the-site

Actual source
http://site.svn.dasprids.de/

东风软 2024-10-01 12:47:26

查看 MediaWiki。这与运行维基百科的软件相同,而且是开源的。

Check out MediaWiki. That's the same software that runs Wikipedia, and it's open source.

动次打次papapa 2024-10-01 12:47:26

PHPBB 怎么样,它既不是框架,也不是库?

您只需进行一些搜索即可找到大量开源网站。特别是博客、内容管理系统等。


编辑:回应对我的答案的第一条评论,我想补充一点,查看开源网站可能有助于了解大型(或不是那么大)的项目,以及经验丰富的开发人员如何完成工作(例如使用 PDO、SQL 事务、模板等)。

但请考虑到,大多数时候,这些项目是由几个人开发的。由于 PHP 没有任何编码标准,并且尽一切可能迫使人们不使用良好实践,因此大型协作项目不太擅长提高编码标准或学习良好实践。为此,书籍可能更有帮助,尤其是有关良好实践的书籍。

What about PHPBB, which is neither a framework, nor a library?

There are also plenty of Open Source websites you can find just by making some search. Especially blogs, content management systems, etc.


Edit: responding to the first comment to my answer, I want just to add that looking at Open Source websites would probably help to have an image of what large (or not so large) projects are, and also how things are done by experienced developers (for example using PDO, SQL transactions, templates, etc.).

But please take in account that most of the time, those projects are developed by several people. And since PHP does not have any coding standard and does everything possible to force the people to not use good practices, large, collaborative projects are not so good at improving your coding standard nor learning good practices. For this, books may me much more helpful, especially books about good practices.

白云不回头 2024-10-01 12:47:26

可能值得一看 wordpress。我没有看过它背后的 php,但我知道我通过查看数据库定义学到了很多东西。

It may be worth looking at wordpress. I haven't looked at the php behind it, but I know I learned a lot looking at the DB definitions.

谁把谁当真 2024-10-01 12:47:26

通常,框架是编写高质量代码和性能之间的良好折衷方案。需要扩展的大型网站会提出自己的自定义技巧,最终演变成框架。根据我用纯 PHP 编写的经验,很容易采用最快的方式来实现某个功能,但最终会得到一堆代码,但其他人可能会更有纪律。

Usually a framework is a good compromise between writing quality code and performance. Larger websites that need scale come up with their own custom hacks which eventually evolve into frameworks. In my experience writing in pure PHP it's too easy to go the quickest way to implementing a feature and end up with a mishmash of code, but others might be more disciplined.

与往事干杯 2024-10-01 12:47:26

不难找到 PHP 示例
代码。

好处是您知道如何查找代码。你说你的代码最终会出现在通用的 MVC 和 CRUDdy 中,我认为这是大多数 Web 应用程序正在做的事情。但这里要考虑的重要事情是他们以托管方式并遵循标准的面向对象设计模式来执行这些 MVC/CRUD 内容。

如果您想获取真实 PHP 应用程序的示例,请搜索该特定类型应用程序的开源代码,而不是框架/库。框架/库是一堆遵循应用程序设计架构组合在一起的 PHP 类,它们应该为您提供一个代码库,以便使用现有的可用代码集启动您的新项目,而不是它们给您“应用程序的感觉”,而不是“结构化的感觉”作为起点。但是,一旦您将这些框架/库一起工作,为您提供构建应用程序的结构化方法,以后事情就会变得非常容易。你的工作是有保证的;)

如果你想使用这些 MVC 框架开发代码,那么就从 Codeigniter 开始。它有很好的文档记录,正如您所说,您现有的代码就像 MVC,您将掌握这个框架以及如何用它一次性构建。我写了一个 Codeigniter 中的 Hello World 你可以参考从它开始。 (另请参阅:Codeigniter 文档

要查找实际应用程序(而不是框架/库)的代码,您可能会想到稍微更改您的搜索查询,搜索网络应用程序类别或类似内容你希望看到的不仅仅是代码做这件事和代码做那件事,而是始终寻找更好、更有效的方式来编码和开发事物。 GithubSourceforge.netGoogle 代码 确实是搜索“real”和“real”的好地方。 “酷”的开源 PHP 应用程序。

It's not hard to find example PHP
code.

Good point is that you know how to find code. You said your code ends up in a generic MVC and CRUDdy, i think this is what most of the web applications around are doing. But the important thing to consider here is they do these MVC/CRUD stuffs in managed way and following standard Object Oriented Design Patterns.

If you want to get examples of real PHP applications then search for open source codes for that specific type application and not frameworks/libraries. Frameworks/libraries are a bunch of PHP CLASSES combined together following the application design architectures and they are supposed to provide you a code base to start your new project with existing set of usable codes, not that they give you the "application feel" rather "structured feel" at the starting point. But once you get along these frameworks/libraries working together to provide you a structured way to build your application, things will really ease later. Your job is guaranteed ;)

If you want to develop codes with these MVC frameworks then start with Codeigniter. It is well documented and as you stated your existing code turns out to be like MVC, you'll grab this framework and how to build with it in one shot. I've written a Hello World in Codeigniter you can refer to start with it. (Also Refer: Codeigniter Documentation)

To find code for real application (not frameworks/libraries) you might think of slightly changing your search queries, search for categories of web application or alike you want to see, not just for the code to do this and code to do that, always search for the better and efficient ways to code and develop things. Github, Sourceforge.net, Google Code are really great places to search for "real" & "cool" open source PHP applications.

情绪操控生活 2024-10-01 12:47:26

嗯,实际上,通过学习像 ie 这样的可靠框架,你可以学到很多东西。 Zend 框架。如果您想了解,我建议您首先查看 Zend Framework 快速入门,然后开始阅读在深渊中生存。一旦您了解了这些,您应该已经了解了 Zend Framework 的基础知识,然后您可以开始查看使用它的开源项目。就 CMS 而言,有一些使用 Zend Framework,例如 TomatoCMSpimCore

顺便说一句,创建网站并不完全是火箭科学,大多数网站实际上只是一组枯燥的 CRUD 屏幕(有时会加入一些 AJAX 以提供更好的用户体验),用于向网站添加内容......

Well, actually you can learn a lot by studying a solid framework like ie. the Zend Framework. If you would like to learn that I suggest you first have a look at the Zend Framework Quickstart and then start reading Surviving the deep end. Once you covered these, you should have learned the basics of the Zend Framework, and then you can start looking at open source projects that use it. As far as CMSes go, there are a few using the Zend Framework, like TomatoCMS and pimCore.

BTW Creating a website isn't exactly rocket science, most sites are in fact just a collection of dull CRUD screens (sometimes spiced up with some AJAX to deliver a better user experience) that are used to add content to the site...

空袭的梦i 2024-10-01 12:47:26

beta.mkforlag.com 上,我尝试新想法并为主开发新页面和新布局域,大部分源代码都可以看到。该网站的大部分内容都是瑞典语,但大部分 php 代码(注释、变量名称等)都是英文的。

您还应该记住,虽然我已经使用 PHP 几年了,但我不是 PHP 专家,而且在很多情况下很可能“做错了”。不过,如果您不是那么先进,您可能会发现至少我的一些代码很有用。

On beta.mkforlag.com, where I try out new ideas and develop new pages and new layout for the main domain, most of the source code can be seen. Most of the site is in Swedish, but most of the php code (comments, variable names etc.) is in English.

You should also keep in mind that although I've been using PHP a couple of years I'm no PHP expert and most likely "doing it wrong" in many cases. If you're not that advanced, though, you may find at least some of my code useful.

梦里南柯 2024-10-01 12:47:26

我的 satya-weblog.com 代码即将上线。我正在使用 WordPress V 2.9,所以下载它,您就会了解我的网站!
也检查一下 symfony 框架,你就会了解 propel、yml 等

My code of satya-weblog.com is almost live. I am using wordpress V 2.9, so download that and you know about my site!
Check at symfony framework also and you come to know of propel, yml etc

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