PHP168 full-site Architecture Analysis + Enterprise Solutions

Source: Internet
Author: User

What makes PHP168 stand-alone is that "one core + multiple modules" can meet different requirements of enterprises. In the past, the whole station program brought together all the functions, which caused a lot of inconvenience to the enterprise. Because many enterprises do not need all the functions, it is not only a burden, but also brings too much interference and a lot of inconvenience. Although some full-site systems have released different versions, such as Enterprise Edition, individual edition, and Enterprise Edition. However, this is not the way out to solve the problem. Although there is a version difference that separates enterprises from individuals, it still ignores a problem. For the enterprise industry, their requirements are different. Therefore, this cannot fundamentally solve the problem.
Taking into account the above situations, in order to bring more convenience to enterprises, individuals, and organizations, the PHP168 full-site development team developed a very effective solution based on years of development experience, that is the current: one core + multiple modules. It can flexibly meet different enterprise, unit, and individual needs. The core must be installed, because it includes the most basic functions of the website, such as user permission Control and Data Backup. What about multiple modules? You can install the required modules as needed. After the installation, you can easily delete it as needed one day. This is very flexible and highly scalable. you can build your own website as needed. It is as easy as building blocks.
The above is a general overview of the PHP168 whole site system. Next, let's share with you some of our special custom function functions on the entire site, because these functions are just like the reinforced concrete pillars of a building without them, it is difficult to build the entire building. So let's start with the most basic functions. Below we have extracted several representative functions to talk to you.

Function table_field ($ table, $ field = ''){
Global $ db;
$ Query = $ db-> query ("SELECT * FROM $ table limit 1 ");
$ Num = mysql_num_fields ($ query );
For ($ I = 0; $ I <$ num; $ I ++ ){
$ F_db = mysql_fetch_field ($ query, $ I );
$ Showdb [] = $ f_db-> name;
}
If ($ field ){
If (in_array ($ field, $ showdb )){
Return 1;
} Else {
Return 0;
}
} Else {
Return $ showdb;
}
}

The above code is a MySQL DATA table processing function that can implement two very important functions. The first function is to determine whether a field exists in a table. Seemingly ordinary functions are actually used in many ways. For example, when upgrading a version, you need to determine whether the user's old database has certain fields. If not, you need to add fields to this table. The above $ table parameter is the data table, and the $ field parameter is the field name. Another important function is to obtain all the fields of a table and return them as arrays. This feature is also very useful. For example, some user-defined forms, after a user adds a field in a custom form, before the program processes data, you need to obtain the fields of the table. Because the fields in the table are changed, you can add or delete them at will.

Function del_file ($ path ){
If (file_exists ($ path )){
If (is_file ($ path )){
If (! @ Unlink ($ path )){
$ Show. = "$ path ,";
}
} Else {
$ Handle = opendir ($ path );
While ($ file = readdir ($ handle ))! = ''){
If ($ file! = ".") & ($ File! = "...") & ($ File! = "")){
If (is_dir ("$ path/$ file ")){
$ Show. = del_file ("$ path/$ file ");
} Else {
If (! @ Unlink ("$ path/$ file ")){
$ Show. = "$ path/$ file ,";
}
}
}
}
Closedir ($ handle );

If (! @ Rmdir ($ path )){
$ Show. = "$ path ,";
}
}
}
Return $ show;
}

The above is a function for deleting files, which is frequently used. As we all know, using the system's own function can only delete a single file, rather than recursively deleting multi-level directories and files, this function solves this problem by deleting not only a single file, but also a multi-level directory. For example, after static data is generated on the entire site, many files and directories are generated. With this function, you can easily delete all the files in a directory.

Everyone wants to know more information, or want to personally experience, don't bother to log on PHP168 Official Website: http://www.php168.com.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.