ThinkPHP class library description

Source: Internet
Author: User
Tags php database
The class library is the core part of ThinkPHP, and ThinkPHP manages all the system class libraries together through the concept of the Base Class Library. The core Base Class Library includes the basic class and common tool class required to complete the universal development of the framework. ThinkPHP Base Class Library

The class library is the core part of ThinkPHP, while ThinkPHP
All system libraries are managed together through the concept of base class libraries. The core Base Class Library includes the basic class and common tool class required to complete the universal development of the framework.

The Base Class Library is located in ThinkPHP
The Lib/Think directory under the system directory consists of the following parts:

Core: Core class library package
Db: database class library package
Exception: Exception handling class library package
Template: built-in Template engine class library package
Util: System Tool Library package

Core class library

Core
Core class libraries include the following class files (directories ):

Think. class. php: System base class
App. class. php: Application class, which executes Application Management
Action. class. php: Controller base class
Model. class. php: Model Base class
Model/AdvModel. class. php: advanced Model class
Model/RelationModel. class. php: Associate Model class
Model/ViewModel. class. php: View Model class
Log. class. php: Log processing class
View. class. php: View output class

Db
Database Class Library

Db
Core class libraries include the following class files (directories ):

Db. class. php: database middle layer implementation class
Driver/DbMysql. class. php: Mysql
Database Driver
Driver/DbMysqli. class. php: Mysqli database Driver class
Driver/DbPdo. class. php: PDO
Database Driver
Driver/DbPgsql. class. php: Pgsql
Database Driver
Driver/DbSqlite. class. php: Sqlite
Database Driver
Driver/DbOracle. class. php: Oracle
Database Driver
Driver/DbMssql. class. php: Mssql
Database Driver
Driver/DbIbase. class. php: Ibase database Driver class

In the Driver
The Directory has different database driver classes for different databases, and then performs class processing through the middle layer of the Db. class. php database, which is displayed in ThinkPHP
The user has a unified database operation model.
Exception handling class library

Exception
The exception handling class library contains only one class File: ThinkException. class. php system exception base class.
Template
Built-in template engine class library

Template
The built-in template engine class library includes the following class files (directories ):.

ThinkTemplate. class. php: built-in template engine class
TagLib. class. php: Tag library base class
TagLib/TagLibCx. class. php: CX
Tag library parsing class
TagLib/TagLibHtml. class. php: HTML tag library parsing class

Util
System Tool Library package

Util
The system Tool Library provides some basic tools for system development, including:

Behavior. class. php: Behavior extension base class
Cache. class. php: Cache management class
Cookie. class. php: Cookie
Management class
Debug. class. php: system debugging class
Dispatcher. class. php: URL
Resolution, routing, and scheduling management
HtmlCache. class. php: static cache class
Session. class. php: Session
Management class
Widget. class. php: plug-in application class
Cache/: various types of Cache file directories, including: file Cache, Sqlite Cache, Apachenote Cache, Memcache Cache, Xcache Cache, and database Cache
Template/: Template engine parsing Directory, including: EaseTemplate Template engine parsing class, TemplateLite Template engine parsing class, Smart Template engine parsing class, Smarty Template engine parsing class, Think Template engine parsing class

ThinkPHP
Extended Class Library

The official ThinkPHP website provides many additional basic class library extensions, which must be stored in ORG or
Manage the Com class library package.

To add a class library to the extension class library package, you can directly copy the class library file to the extension Class Library Management Directory. For example
Util/Page. class. php paging extension class library, which is directly written to the extension class library management directory to form Lib/ORG/Util/Page. class. php
You can.

You must use the import command to import the extended class library. For more information, see ThinkPHP import.
Class Library import.
Application Library

An application library is a class library defined or used by the project. The application library directory is located in the Lib directory under the Project Directory.

The above is
ThinkPHP core-class library introduction. ThinkPHP class library helps us understand ThinkPHP
The hierarchical structure and working principle of the class library. if necessary, refer to the source code of these class libraries to help solve the problem.

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.