


A brief description of the plug-in controller function of ThinkPHP3.2.2, a brief description of thinkphp3.2.2_PHP tutorial
A brief description of the plug-in controller function of ThinkPHP3.2.2, a brief description of thinkphp3.2.2
ThinkPHP supports the calling of plug-in controllers starting from version 3.2.2. You can access the controller defined by a plug-in in the module through a more convenient URL address.
When the plug-in controller variable is passed in the URL, the operation method in the plug-in controller will be automatically located.
The variables of the plug-in controller are set by the parameter VAR_ADDON. The default is addon. For example, we pass it in the URL:
http://serverName/Home/info/index/addon/SystemInfo
Due to the addon parameter being passed in, the User controller here is not the original one
Home/Controller/InfoController.class.php
Instead, the InfoController controller of the SystemInfo plug-in (located under the Home/Addon directory) is called. The file is located at
Home/Addon/SystemInfo/Controller/InfoController.class.php
The definition of the plug-in controller itself is the same as that of an ordinary access controller, for example:
namespace Home\Addon\SystemInfo\Controller; class InfoController extends \Think\Controller{ public function index(){ echo 'Addon SystemInfo'; } }
In this way, we are visiting
http://serverName/Home/info/index/addon/SystemInfo
will be output
Addon SystemInfo
If our plug-in directory is not Addon, but Plugin, then it needs to be defined in the configuration file:
'VAR_ADDON' => 'plugin'
Then the access URL address becomes
http://serverName/Home/info/index/plugin/SystemInfo
It should be noted that: Currently, the plug-in controller only supports module plug-in controller access, and does not yet support global public plug-ins.
Basic components of PLC:
1. Central processing unit: receives and processes data; receives the status and data of on-site input equipment by scanning; self-diagnoses; completes logical arithmetic operation tasks specified in the user program.
2. Memory: There are three types of RAM, EPROM, and EEPROM
EPROM: stores system programs, read-only memory, cannot be changed.
RAM: Stores I/O images and various soft devices. It is a read-write memory with fast storage speed.
EEPROM: It is an erasable read-only memory.
3. Input/output (I/O) interface: It is the connection component between the CPU and field (I/0) devices or other external devices.
4. Power supply:
5. The programmer is used for compiling, editing, debugging, checking and monitoring of user programs.
CPU Principle
The main function of the CPU is to execute programs stored in the main memory, that is, machine instructions. The CPU is composed of a controller and arithmetic unit.
Overview of this Chapter
The focus of this chapter is: the basic components of the CPU and Instruction flow. This involves the core issues of establishing the concept of the whole machine: how the CPU executes instructions, how the computer stores information, and how to control input/output.
1. The basic composition of the CPU
2. Formulate the instruction flow
1. The basic composition of the CPU
When understanding the composition of the CPU, you need to grasp the following points:
(1) ALU component, and its input and output methods.
(2) Used for calculations A set of registers R0-R3 or temporary registers C, D, Z
(3) A set of registers used for control: instruction register IR, program counter PC, program status word register PSW
(4) and A set of registers related to memory access: memory address register MAR, memory data status word register MDR, stack pointer SP
(5) The connection method of the internal bus line, how to send information to it, and how it outputs information
( 6) How the CPU connects to the main memory and I/O devices through the system bus line
Section 3.3.1 gives a simplified internal composition model of the CPU, which is the basis for formulating the instruction process.
2. Formulated Instruction flow
Instruction flow embodies a core content in the working principle of computers: how the CPU executes program instructions. The assessment method is to give a specific instruction, with the internal composition of the model machine CPU as the background, and use instruction sentences to describe its reading and execution. Process. The key is to master the implementation process of several basic addressing methods, distinguish who is the source address, who is the destination address, and what the operation code is
For example: draw up the instruction MOV -(SP),X(R0) Reading and execution process.
Learning content:
3.1 Arithmetic logic operation component ALU
3.2 Operation method
3.3 The composition of the CPU model and its data path
3.4 Timing control method
3.5 Execution of instructions and combinational logic controller
3.6 Microprogrammed controller
Learning objectives:
Understand the logical formula and structure of the full adder, the parallel adder and the carry chain used, and multi-functional arithmetic and logical operations Functions of component SN74181.
Master the initial code fixed-point addition and subtraction operations, shift operations, understand floating point addition and subtraction operations, decimal addition operations, master unsigned integer one-bit multiplication and understand its logical implementation, and master unsigned integers One-digit division, understand floating point multiplication and division operations.
Learning goals:
Master the basic components of the model machine, data path and data transmission, master the basic form of micro-commands.
Understand the functions of the controller, master the instructions The working principle of process and combinational logic controller.
Master the concept of micro-program control, understand the encoding method and sequence control method of micro-instructions, and understand the format of micro-instructions.
Key points and difficulties:
Complementary code fixed-point addition Subtraction operations, unsigned integer one-bit multiplication and division. (Difficulty)
The basic composition of the model machine, data path and data transmission, and the basic form of microcommands.
The instruction flow and the working principle of the combinational logic controller .(Key points)
Class schedule:
9 classes.
Media use:
Use multimedia projection, mainly using electronic teaching plans prepared by PowerPoint.
§ 3.1 Arithmetic and logical operation component ALU
ALU is a powerful combinational logic circuit, sometimes called a multi-functional function generator.
The core of ALU is the adder.
ALU mainly completes fixed-point arithmetic operations and logical operations on binary codes.
§ 3.1.1 Adding unit
Full adder and half adder:
An An-1…Ai…A2 A1 A0
Bn Bn-1…Bi…B2 B1 B0
+ Cn Cn-1…Ci…C2 C1 C0
The full adder is an adder unit that considers three inputs, and the half adder is an adder unit that considers two inputs.
Full addition sum ∑i + carry to high bit Ci
The carry Ci sent in from the low bit
Input quantity
Output quantity
Use a half adder to form a full adder
(1) Half-add summation can be implemented with an XOR gate:
Half-add Sum = AiOBi (logical formula of half adder)
Half adder is also called XOR gate
(2) Full adder = two half adders, its logical formula:
∑i=AiOBiOCi
C i+1=AiBi+(AiOBi)Ci
Because there is a delay time in logic gate circuits, the full adder circuit is a delay component, and its characteristics will affect the speed of the full adder.
+
+
+
+
+
§ 3.1.2 Parallel adder and carry chain structure
Parallel adder: It uses an n-bit full adder to realize two n-bit operands at the same time Add up, the rest of the text>>

Thedifferencebetweenunset()andsession_destroy()isthatunset()clearsspecificsessionvariableswhilekeepingthesessionactive,whereassession_destroy()terminatestheentiresession.1)Useunset()toremovespecificsessionvariableswithoutaffectingthesession'soveralls

Stickysessionsensureuserrequestsareroutedtothesameserverforsessiondataconsistency.1)SessionIdentificationassignsuserstoserversusingcookiesorURLmodifications.2)ConsistentRoutingdirectssubsequentrequeststothesameserver.3)LoadBalancingdistributesnewuser

PHPoffersvarioussessionsavehandlers:1)Files:Default,simplebutmaybottleneckonhigh-trafficsites.2)Memcached:High-performance,idealforspeed-criticalapplications.3)Redis:SimilartoMemcached,withaddedpersistence.4)Databases:Offerscontrol,usefulforintegrati

Session in PHP is a mechanism for saving user data on the server side to maintain state between multiple requests. Specifically, 1) the session is started by the session_start() function, and data is stored and read through the $_SESSION super global array; 2) the session data is stored in the server's temporary files by default, but can be optimized through database or memory storage; 3) the session can be used to realize user login status tracking and shopping cart management functions; 4) Pay attention to the secure transmission and performance optimization of the session to ensure the security and efficiency of the application.

PHPsessionsstartwithsession_start(),whichgeneratesauniqueIDandcreatesaserverfile;theypersistacrossrequestsandcanbemanuallyendedwithsession_destroy().1)Sessionsbeginwhensession_start()iscalled,creatingauniqueIDandserverfile.2)Theycontinueasdataisloade

Absolute session timeout starts at the time of session creation, while an idle session timeout starts at the time of user's no operation. Absolute session timeout is suitable for scenarios where strict control of the session life cycle is required, such as financial applications; idle session timeout is suitable for applications that want users to keep their session active for a long time, such as social media.

The server session failure can be solved through the following steps: 1. Check the server configuration to ensure that the session is set correctly. 2. Verify client cookies, confirm that the browser supports it and send it correctly. 3. Check session storage services, such as Redis, to ensure that they are running normally. 4. Review the application code to ensure the correct session logic. Through these steps, conversation problems can be effectively diagnosed and repaired and user experience can be improved.

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.


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

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

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
