個(gè)人觀點(diǎn),道一下對(duì) PHPCMS 的網(wǎng)站架構(gòu)的看法
Jun 13, 2016 pm 12:00 PM
個(gè)人觀點(diǎn),說一下對(duì) PHPCMS 的網(wǎng)站架構(gòu)的看法
PHPCMS應(yīng)該是國(guó)內(nèi)第一家用MVC架構(gòu)來寫開源PHP產(chǎn)品的,我第一次工作上接觸到PHPCMS是在兩年前,那個(gè)時(shí)候?qū)VC還是不理解,然后因?yàn)楣ぷ餍枰?,需要修改一下PHPCMS的源碼。拿到代碼后,我一開始還本著一種從PHPCMS入手來理解MVC模式,可研究了半天,心里一直想著這就是人人稱贊的MVC架構(gòu)嗎?怎么而看都感覺不出哪里的優(yōu)勢(shì),卻讓人很容易聯(lián)想到discuz的架構(gòu)。
(截圖:phpcms的源碼,來自文件D:\www\phpcms\phpcms\modules\content\content.php)
今天重新拿到PHPCMS的代碼,重新看了下。
在自己理解了MVC,并且看過大部分的人氣比較高的MVC框架,國(guó)內(nèi)的ThinkPHP、國(guó)外的symfony2 laravel以及yii之后再來看PHPCMS,再來評(píng)價(jià)下PHPCMS:
1)結(jié)構(gòu)混亂,命名沒有任何規(guī)則,比如前臺(tái)可以訪問的加action前綴之類的。
2)有必要在開頭第一段寫上判斷嗎?為什么不直接用.htaccess禁止任何人訪問 /phpcms這個(gè)目錄?
3)phpsso_server 這個(gè)目錄寫法完全是抄襲discuz,拖油瓶。
4)phpcms一直宣稱MVC,讓人覺得技術(shù)上很厲害,但是實(shí)際上運(yùn)行起來非常緩慢,卡得無比。
PHPCMS是用PHP4的架構(gòu)思路來完成MVC模式。
今天重新看了PHPCMS的源碼,才明白了自己當(dāng)時(shí)為什么會(huì)有那種感受“這就是傳說中人人稱贊的MVC嗎”,還對(duì)MVC產(chǎn)生排斥感。PHPCMS的寫法完全是一種PHP4的寫法,嚴(yán)格來說根本就不符合MVC規(guī)范,根本就不是MVC架構(gòu)!最后要說的是,用PHP4的思路架構(gòu)寫出PHPCMS這樣一個(gè)系統(tǒng)來,比用MVC寫出來累,且維護(hù)成本比流行MVC框架開發(fā)出來的程序高(時(shí)間精力上)。(by default7#zbphp.com)

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

"Detailed Explanation of Discuz Registration Process: Allowing you to easily modify personal information, specific code examples are required" Discuz is a powerful community forum program that is widely used in various websites. It provides a wealth of user registration and personal information modification. functions and interfaces. This article will introduce you to Discuz's registration process in detail and provide specific code examples to help you easily customize and modify your personal information. 1. User registration process In Discuz, user registration is one of the important functions of the site. The smoothness of the registration process and

PHP CMS is a PHP-based open source content management system for managing website content. Its features include ease of use, powerful functionality, scalability, high security, and free open source. It can save time, improve website quality, enhance collaboration and reduce development costs, and is widely used in various websites such as news websites, blogs, corporate websites, e-commerce websites and community forums.

A must-have for Discuz users! Comprehensive analysis of renaming props! In the Discuz forum, the name change function has always received much attention and demand from users. For some users who need to change their name, name change props can easily modify the user name, and this is also an interesting way of interaction. Let’s take an in-depth look at the renaming props in Discuz, including how to obtain them, how to use them, and solutions to some common problems. 1. Obtain name-changing props in Discuz. Name-changing props are usually purchased through points or the administrator

Discuz Editor: An efficient post layout tool. With the development of the Internet, online forums have become an important platform for people to communicate and share information. In the forum, users can not only express their opinions and ideas, but also discuss and interact with others. When publishing a post, a clear and beautiful format can often attract more readers and convey more accurate information. In order to facilitate users to quickly type and edit posts, the Discuz editor came into being and became an efficient post typesetting tool. Discu

Detailed explanation of the steps to modify the Discuz domain name. Specific code examples are required. With the development and operation of the website, sometimes we need to modify the domain name of the Discuz forum. This may be due to brand change, website SEO optimization, or other reasons. No matter what the reason is, modifying the Discuz domain name is a process that requires careful operation. Today we will introduce the steps of modifying the Discuz domain name in detail and provide specific code examples. Step 1: Back up data. Before modifying the domain name, you must first ensure that the website

How to optimize the display of the number of people online in Discuz Share Discuz is a commonly used forum program. By optimizing the display of the number of people online, you can improve the user experience and the overall performance of the website. This article will share some methods to optimize the display of online people and provide specific code examples for your reference. 1. Utilize caching In Discuz’s online population display, it is usually necessary to frequently query the database to obtain the latest online population data, which will increase the burden on the database and affect the performance of the website. To solve this problem, I

Title: WeChat Login Integration Guide: PHPCMS in Action In today’s Internet era, social login has become one of the essential functions of a website. As one of the most popular social platforms in China, WeChat’s login function is also used by more and more websites. This article will introduce how to integrate the WeChat login function in the PHPCMS website and provide specific code examples. Step 1: Register a WeChat Open Platform Account First, we need to register a developer account on the WeChat Open Platform and apply for the corresponding development permissions. Log in [WeChat open platform]

Forum is one of the most common website forms on the Internet. It provides users with a platform to share information, exchange and discuss. Discuz is a commonly used forum program, and I believe many webmasters are already very familiar with it. During the development and management of the Discuz forum, it is often necessary to query the data in the database for analysis or processing. In this article, we will share some tips for querying the location of the Discuz database and provide specific code examples. First, we need to understand the database structure of Discuz
