


A detailed introduction to the best secondary development of cms
◆Secondary development
What is secondary development?
Secondary development, simply put, is to use existing software Make customized modifications, expand functions, and achieve the functions and effects you want. Generally speaking, the core of the original system will not be changed.
Why secondary development?
With the continuous development of information technology, a series of excellent open source works have emerged in the IT industry, and their authors or individuals , or a project team, or
is a software company. Selecting and applying these excellent open source software, and carrying out secondary development that meets business needs on this basis, will save enterprises informationization costs (time costs and development costs), and at the same time, it can also bring Technical guarantee. This is what we often hear: standing on the shoulders of giants, you will see further. Therefore, many domestic companies need secondary development talents.
How to do secondary development?
First, you must have a language foundation for the language used in this open source product. Being able to understand the code is the most basic.
Second, you need to be familiar with the functions and uses of this open source product. Only when you are familiar with it will you know what you want to change and what is the requirement. It comes with the system, how can I change it? Third, you must be familiar with the data structure, code structure, system framework structure of this open source product, what is the core, and where are the subsidiary functions.
To put it simply, it means familiarity with databases, code logic, and file directories.
Fourth, according to your needs, then use the core of the open source product to expand and modify the system to meet your needs. Introduce the basics of secondary development of PHP open source
products Requirements:
First, basic requirements: HTML (must be very familiar with it), PHP (can understand code and write some small systems, such as message boards, small CMS),
Mysql (know at least one database), Javascript (can understand it and can modify some existing codes), p+Css (can adjust the interface and understand how CSS
is used)
Second, be familiar with the use of open source products, such as Dedecms. You need to know how to log in, how to create a new column, how to add articles, how to use template tags, the concept and use of models, etc. Function
Third, you must be familiar with the database structure of this open source product, and understand the contents of the core files inside, such as: how to use the database class, how to perform commonly used security filtering , how to use the template engine and other core contents. You also need to know the directory structure of this open source product, that is to say, you need to know where the templates are placed, where the controls are placed, where the styles are placed, etc.
4. Familiarize yourself with your needs, interpret them, and then determine how to modify and expand this open source product
What can you get after secondary development?
You can fulfill your needs and you can accumulate experience. The experience here is your own and that of others. The so-called other people's is that when you do this second development, you can absorb the essence of this system and then integrate it into your own thinking, and you can also summarize the experience of the project architecture. There is a saying
that is good, that is: smart people will regard other people's failure experience as their own experience, while stupid people will take it as their own experience after experiencing countless failures.
ownexperience. Secondary development is not just development, but more importantly, absorbing the essence, summing up experience, straightening out ideas, avoiding detours, and improving oneself.
Standing on the shoulders of giants, you will see further!!! ◆DedeCMS secondary development
In order to let more people understand the secondary development and understand the secondary development of DedeCMS more conveniently, the following will briefly introduce some basics and outlines of the secondary development of DedeCMS
Necessary foundation for secondary development of DedeCMS:
· Very familiar with HTML · Familiar with the layout of p+CSS
· Solid PHP foundation, Familiar with structured programming, understand OOP, and be able to understand and use · Familiar with MYSQL, master the SQL language
DedeCMS secondary development learning process
· Understand what CMS is · Be familiar with the functions of DedeCMS (such as column classification, document management, use of models, system settings and other common functions)
· Master the templates of DedeCMS Tag usage and principles
· DedeCMS directory structure analysis
Familiar with what files are mainly installed in each folder, so that you know what files in which folder to modify during secondary development
Directory structure summary:
./a Generated file storage path
./data Cache file and data center
/admin Manage background data
/backupdata backup data
/cache cache file
/enums level linkage data, JS, enumeration type cache file
/ js Commonly used JS /mark watermark related files
/module module installation file
/rss Rss related
/sessions Session storage path
/textdata text data
/tplcache template cache
/uploadtmp upload file cache location
/ziptmp zip package decompression cache location
……
DedeCMS file structure analysis
Familiar with the basic functions of each file, it is convenient to make modifications. After knowing the general function of each file, you can easily modify the files
File structure summary:
common.inc.php database configuration file
config.cache.bak.php background system configuration backup
config.cache.inc.php Backend system configuration file cache
downmix.data.php collection obfuscated cache file
mysql_error_track.inc MYSQL error log
safequestions.php Security Questions
Sitemap.html Site Map
sys_pay.cache.php Payment Gateway Configuration
Template.rand.php Random Template Settings
……
· DedeCMS database structure analysis, at least be familiar with the role of each table
Familiar with the role of each table, understand the design of several core tables and the meaning of the fields, so that it is convenient to obtain After new requirements are met, you can quickly determine whether to add a
segment or create a new table for processing. At the same time, you can also understand the database design ideas of DedeCMS and add useful design ideas to your own system.
·DedeCMS process control and analysis of some core files
Familiar with some common process controls such as login, registration, document management, permission control, classification management, model setting, etc.
Dissect several core files to understand their programming skills and security mechanisms
· Development of DedeCMS plug-ins (**** plug-ins and embedded plug-ins)
Familiar with the writing of two plug-ins, the import and export of plug-ins, and the use of plug-in matching models
◆Ecshop secondary development
EcShop secondary development learning Method
In recent years, with the development of the Internet, e-commerce has also grown along with it, and B2B, C2C, and B2C e-commerce models have also continued to mature. At this time
spawned many e-commerce related PHP open source products. In terms of B2C, there are well-known products at home and abroad such as Ecshop, Zencart, Magento, etc.
Let’s briefly introduce the process of learning Ecshop secondary development and some things to pay attention to:
The necessary foundation for Ecshop secondary development:
· Very familiar with HTML
· Familiar with the layout of p+CSS
· Solid PHP foundation, familiar with structured programming, understanding of OOP, and able to understand and use
· Familiar with Smarty template engine
· Familiar with MYSQL and master the SQL language
· Ecshop secondary development learning process
· Familiar with the basic concepts of e-commerce
· Be familiar with the basic functions of EcShop (product types, product classifications, product attribute settings, use of promotional activities, etc.)
· Master the database structure and database design ideas of Ecshop
· Familiar with the ER model, the establishment of entities and relationships
Familiar with the role of each table, the design of several core tables and the meaning of the fields, so that you can quickly judge whether to obtain new requirements. Add the
paragraph or create a new table for processing. At the same time, you can also understand Ecshop’s database design ideas and add useful design ideas to your own system
· File structure analysis and code analysis
Familiar with some login, registration, document management, and permissions Control, classification management, commodity type and other common process controls.
Dissect several core files to understand their programming skills and security mechanisms
· Ecshop file structure analysis:
\includes\cls_captcha.php: Verification code image Class
\includes\cls_ecshop.php: Basic class
\includes\cls_ecshop.php(56): Password compilation method;
\includes\cls_rss.php: RSS Class
\includes\cls_smtp.php: SMTP mail class
\includes\inc_constant.php: Constant
\includes\init.php: Frontend common file
\includes\lib_common.php: Common function library
\includes\lib_goodscat.php: Front-end common function library
\includes\lib_insert.php: Dynamic content function library
\includes\lib_main.php: Front-end public function library
\includes\lib_payment.php: Payment interface function library
\includes\iconv\cls_iconv.php: Character set conversion class
\includes\ip\cls_ip.php: IP location query class
\includes\modules\integrates\discuz.php: Member data processing class
\includes\ modules\integrates\ecshop.php: Member data processing class
Ecshop template replacement
Familiar with the use of the streamlined version of Smarty, embedding your own interface, EcShop template replacement skills
Ecshop secondary development example
The function of switching between Chinese and English, the flash sale function, the production of JD.com templates, etc.
Learning objectives:
1 , Will use Ecshop for secondary development
2. Will change ordinary templates and modify some functions
3. Learn from the development experience inside
Master the basic knowledge-》 Imitate some of the writing methods inside-》Modify the patterns inside (form your own development model)
Master the programming skills and system design skills in Ecshop
◆Caching technology analysis
Analysis of common PHP caching technology [Conceptual version]
In most cases our website will use a database as a container for site data storage. When you execute a SQL query, the typical process is: connect to the database -> prepare the SQL query - > send the query to the database - > get the results returned by the database - > close the database connection. However, some data in the database
is completely static or changes infrequently. The caching system will cache the results of the SQL query to a faster storage system to store
. Avoiding frequent database operations greatly improves program execution time, and caching query results also allows you to process them later.
Commonly used caching technology
Data cache: The data cache mentioned here refers to the database query cache. Every time a page is accessed, the corresponding cached data will be first detected
Exists, if not, connect to the database, obtain the data, and serialize the query results and save them to the file
. In the future, the same query results will be obtained directly from the cache file.
Page cache:
Every time you access a page, it will first check whether the corresponding cached page file exists. If it does not exist, connect to the database and get the data,
Display the page and generate a cached page file at the same time, so that the page file will be effective the next time you visit. (Template engines and some common cache classes on the Internet usually have this function)
Memory cache:
I won’t introduce it here. It is not what this article will discuss. A brief mention:
Memcached is a high-performance, distributed memory object caching system used to reduce database load and improve access speed in dynamic applications.
Dbcached is a distributed key-value database memory cache system based on Memcached and NMDB.
Although the above caching technology can well solve the problem of frequent database queries, its shortcoming is that the data is not timely. Here I give the methods I commonly use in
projects:
Time triggered cache:
Check whether the file exists and the timestamp is less than the set expiration time. If the file modification timestamp is less than the current timestamp minus the expiration timestamp
If it is large, then use the cache, otherwise update the cache.
Don’t judge whether the data needs to be updated within the set time, and update the cache after the set time. The above is only suitable for use
when the timeliness requirements are not high, otherwise please see below.
Content-triggered caching:
When data is inserted or updated, the cache is forced to be updated.
Here we can see that when a large amount of data needs to be updated frequently, disk read and write operations will eventually be involved. How to solve it? In my daily
projects, I usually do not cache all the content, but cache some content that does not change frequently to solve the problem. But in the case of heavy load, it is best to use shared
memory as a cache system.
At this point, PHP caching may be a solution, but its disadvantage is that because each request still needs to be parsed by PHP, under heavy load, the efficiency problem is still more serious than the efficiency problem. , in which case static caching may be used.
Static cache
The static cache mentioned here refers to HTML cache. HTML cache generally does not need to determine whether the data needs to be updated, because it is usually used in places where HTML is used
Generally, pages that do not change content frequently. When the data is updated, just force the HTML to be updated.
In fact, a caching system involves many problems. I will only introduce my usual caching ideas here, and I will not introduce the use of software to
implement caching and write specific codes.
If you have any good solutions, please submit them below and let us discuss them together.
◆PHP uses function calling commandsPHP uses functions such as exec and system to call system commands
PHP’s built-in functions exec and system can be used Call system commands (shell commands), and of course passthru, escapeshellcmd and other functions. In many cases, using PHP's exec, system and other functions to call system commands can help us complete our work better and faster. For example, exec helped me a lot when I was batch processing .rar files two days ago.
Today I will sort out the commonly used calling system functions and share my experience with everyone.
Note: If you want to use these two functions, the safe mode in php.ini must be turned off, otherwise for the sake of security, PHP will not allow you to call the system command
.
First, let’s take a look at the explanation of these two functions in the PHP manual:
exec --- Execute external programs
Syntax: string exec ( string command [, array &output [ , int &return_var]] )
Explanation:
exec() executes the given command command, but it does not output anything, it simply returns the last line from the result of the command ,like
If you need to execute a command and obtain all data from the command, you can use the passthru() function.
If the parameter array is given, the specified array will be filled with each line output by the command. Note: If the array previously contains some
elements, exec() It will be appended to the end of the array. If you don't want this function to append elements, you can call unset() before passing the array to
exec().
If the parameters array and return_var are given, the status command returned to execution will be written to this variable.
Note: If you allow data from user input to be passed to this function, then you should use escapeshellcmd() to ensure that
this user cannot trick the system into executing Arbitrary order.
Note: If you use this function to start a program and want to leave it while it is executing in the background, you must make sure
that the output of the program is redirected ) to a file or some output data stream, otherwise PHP will hang until the program execution
ends.
System --- Execute the external program and display the output
Syntax: string system ( string command [, int &return_var] )
Description:
system ( ) Execute the given command command and output the result. If the parameter return_var is given, the status code of the executed command will be
written to this variable.
Note: If you allow data from user input to be passed to this function, then you should use escapeshellcmd() to ensure that
this user cannot trick the system into executing Arbitrary order.
Note: If you use this function to start a program and want to leave it while it is executing in the background, you must make sure
that the output of the program is redirected ) to a file or some output data stream, otherwise PHP will hang until the program execution
ends.
If PHP is running as a server module, system() will try to automatically clear the web server's output buffer after outputting each line.
Returns the last line of the command if successful, false if failed.
If you need to execute a command and obtain all data from the command, you can use the passthru() function.
Both of these are used to call system shell commands,
The difference is:
exec can return all execution results to the $output function (array), $status is the status of execution, 0 is success, 1 is failure
Systerm does not need to provide the $output function, it returns the result directly, similarly $return_var is the status code of execution, 0 is success, 1
为FAILURE
◆About open source
The biggest success of open source comes from the Web
The open source movement is widely popular and has written a strong mark in the history of software development. But where is its most far-reaching impact? What is the most
successful open source "project" in history?
In fact, overall, isn't the Web an open source movement? The biggest success?
Perhaps the most famous example is LAMP behind many websites in hidden domains, which is Linux, Apache, MySQL and PHP. But when you think about it
, you'll find more.
Listed below are some open source projects that enable the Web to run.
Web browsers-Web browser
In the web browser market, although Microsoft's closed source software IE browser still occupies a large share, other open source projects with similar functions
has become popular and continues to grow. Like Mozilla's Firefox browser (it is open source, as well as Flock and PaleMoon). There are also rapidly growing Webkit-based browsers, like Safari, but the most famous is Chrome.
If you include mobile networks, Webkit dominates the browsers in iPhone, Android and Blackberry phones.
Web server software-Web server software
So far, Apache is the most widely used network server software. It is open source, but a lightweight server software called Nginx
pieces have become popular in recent years. In fact, two of the three top web server software are open source (the exception is Microsoft's IIS, which ranks second, but it is far from first).
In addition, a large number of server-side underlying software are also open source. For example, many high-traffic websites use Varnish as the caching layer with website visitors, and use Memcached as the caching layer with the website database. These are just two of many examples.
Scripting languages and web frameworks-Scripting languages and Web frameworks
Most of the programming and scripting languages used on the Internet are open source, such as PHP, Perl, Python, Ruby, etc.
However, few websites are completely built from scratch. It is no exaggeration to say that there are hundreds of open source content management systems (CMS) and web frameworks to assist developers, such as WordPress, Drupal, Ruby on Rails, Django, Joomla, DedeCMS, Ecshop, etc. .
Databases-database
The open source software MySQL is by far the most popular website database, but there are other open source software with similar functions, such as PostgreSQL, not to mention the many "non-relational (NoSQL)" that have appeared recently. database.
Since we are talking about the underlying software, we have to mention the basic
system that we rely on every time we use the Internet or anything on the Internet:
DNS-Domain Name Resolution System
The Web (for that matter, the entire Internet) is nothing without the domain name resolution system. As we all know, the domain name resolution system allows users to use domain names like example.com instead of IP addresses. BIND is pretty much the de facto standard for DNS server (aka name server) software, and, as you've probably guessed by now, it's open source.
Server operating systems-Server operating systems
All websites must run on servers, and that is where open source reigns. Although Windows dominates the desktop space, most of the servers that websites run on use the open source Linux operating system. Other popular choices are freeBSD and OpenBSD.
The temptation of open source
Because in many cases, open source software can provide the same performance as commercial closed source software and is free, so open source software
It's no surprise that it's so popular. Free is a hard price to beat.
If the Web didn't run on all this free software, it would probably have a hard time gaining widespread acceptance.
Note that we did not say that there is no closed source software on the Web, but that obviously exists. However, from a statistical point of view, the real exception in the field of Web open source dominance is Microsoft's Windows-based series of systems.
Beyond that, you usually have to dig deeper to find more proprietary closed source technologies, like the operating systems on routers and similar devices. But that
is the Internet, not the Web.
The above is the detailed content of A detailed introduction to the best secondary development of cms. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

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

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

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

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

Users may have seen the term wapi when using the Internet, but for some people they definitely don’t know what wapi is. The following is a detailed introduction to help those who don’t know to understand. What is wapi: Answer: wapi is the infrastructure for wireless LAN authentication and confidentiality. This is like functions such as infrared and Bluetooth, which are generally covered near places such as office buildings. Basically they are owned by a small department, so the scope of this function is only a few kilometers. Related introduction to wapi: 1. Wapi is a transmission protocol in wireless LAN. 2. This technology can avoid the problems of narrow-band communication and enable better communication. 3. Only one code is needed to transmit the signal

Pubg, also known as PlayerUnknown's Battlegrounds, is a very classic shooting battle royale game that has attracted a lot of players since its popularity in 2016. After the recent launch of win11 system, many players want to play it on win11. Let's follow the editor to see if win11 can play pubg. Can win11 play pubg? Answer: Win11 can play pubg. 1. At the beginning of win11, because win11 needed to enable tpm, many players were banned from pubg. 2. However, based on player feedback, Blue Hole has solved this problem, and now you can play pubg normally in win11. 3. If you meet a pub

Introduction to Python functions: Introduction and examples of exec function Introduction: In Python, exec is a built-in function that is used to execute Python code stored in a string or file. The exec function provides a way to dynamically execute code, allowing the program to generate, modify, and execute code as needed during runtime. This article will introduce how to use the exec function and give some practical code examples. How to use the exec function: The basic syntax of the exec function is as follows: exec

i5 is a series of processors owned by Intel. It has various versions of the 11th generation i5, and each generation has different performance. Therefore, whether the i5 processor can install win11 depends on which generation of the processor it is. Let’s follow the editor to learn about it separately. Can i5 processor be installed with win11: Answer: i5 processor can be installed with win11. 1. The eighth-generation and subsequent i51, eighth-generation and subsequent i5 processors can meet Microsoft’s minimum configuration requirements. 2. Therefore, we only need to enter the Microsoft website and download a "Win11 Installation Assistant" 3. After the download is completed, run the installation assistant and follow the prompts to install Win11. 2. i51 before the eighth generation and after the eighth generation

After updating to the latest win11, many users find that the sound of their system has changed slightly, but they don’t know how to adjust it. So today, this site brings you an introduction to the latest win11 sound adjustment method for your computer. It is not difficult to operate. And the choices are diverse, come and download and try them out. How to adjust the sound of the latest computer system Windows 11 1. First, right-click the sound icon in the lower right corner of the desktop and select "Playback Settings". 2. Then enter settings and click "Speaker" in the playback bar. 3. Then click "Properties" on the lower right. 4. Click the "Enhance" option bar in the properties. 5. At this time, if the √ in front of "Disable all sound effects" is checked, cancel it. 6. After that, you can select the sound effects below to set and click

In Hua Yishan Heart Moon, Lu Shu is an SSR celebrity. He is positioned as a single-target backline player and has a very impressive critical hit rate. Many players don’t know much about Lu Shu. Here’s what I’ve brought you. Come and take a look at the introduction to the skills and attributes of Hua Yishan Heart of the Moon Lu Shu. Celebrity Attributes Celebrity Skills 1. Lu Ming Shuzhong Skill Description: Lu Shu was born in Qiongqihui in Shuzhong. He has practiced martial arts since he was a child and has outstanding martial arts skills. Causes basic attack damage equal to 100% of the enemy's back row attack power, and reduces the target's rage by 10 points. Skill attributes: Level 2: Basic attack damage increased to 105%. Level 2: Basic attack damage is increased to 110%, and the target's rage is reduced by 15 points. Level 2: Basic attack damage increased to 115%. Level 2: Basic attack damage is increased to 120%, and the target's rage is reduced by 20 points. Level 2: Basic attack

PyCharm is a powerful Python integrated development environment with rich functions and tools that can greatly improve development efficiency. Among them, the replacement function is one of the functions frequently used in the development process, which can help developers quickly modify the code and improve the code quality. This article will introduce PyCharm's replacement function in detail, combined with specific code examples, to help novices better master and use this function. Introduction to the replacement function PyCharm's replacement function can help developers quickly replace specified text in the code

Many users have printer drivers installed on their computers but don't know how to find them. Therefore, today I bring you a detailed introduction to the location of the printer driver in the computer. For those who don’t know yet, let’s take a look at where to find the printer driver. When rewriting content without changing the original meaning, you need to The language is rewritten to Chinese, and the original sentence does not need to appear. First, it is recommended to use third-party software to search. 2. Find "Toolbox" in the upper right corner. 3. Find and click "Device Manager" below. Rewritten sentence: 3. Find and click "Device Manager" at the bottom 4. Then open "Print Queue" and find your printer device. This time it is your printer name and model. 5. Right-click the printer device and you can update or uninstall it.
