pagination, image watermark, thumbnail image processing tool class, PHP error mechanism

Source: Internet
Author: User
Tags configuration settings php error

1. Paging Technology "Limit" paging technology is the size of each page and the current page, page control, to achieve paging function

Use pagination to show related list information.

"The company's paging is handled through the interface, because we only use the displayed part, not the operation of the library, so it is relatively simple." Use the Ajax calling interface to implement the asynchronous display of paging "

"Make a paging tool class"

"GD picture processing related" 2. Thumbnail steps: (1) sample on the original image to obtain a copy of the acquisition area (2) on the original image: Copy the file (3) Modify: Modify the file size (4) export (imagejpeg) and destroy the resource (destory)

Imagecopyresampled (): Sample copy modification is equivalent to creating a new canvas, creating a new area for zooming the paint function. Note that this function uses a parameter "more, because the parameters of the original and new thumbnails are required"

"There is a comparison of the proportions and sizes of the pictures in the thumbnail processing"

3. Add watermark to merge one picture onto another picture Imagecopymerge ()

is still the operation of two pictures

4. Do a picture processing class implementation of watermark and image scaling processing.

Error message in "Focus" 5.php: "Speaking of Grammatical Hints" (1) standard error PHP errors in syntax are divided into two processes: the triggering and processing stages of the error.

The "trigger phase" is the error that PHP core finds when it executes and compiles PHP code, and triggers the error. You can also use Trigger_error (): Trigger a user-defined error "Manual custom error Prompt" This is for us to better define where the error occurred "error log" This is equivalent to the error is divided into two kinds: one is PHP execution error, The other is how we want to deal with this when it happens. (This error is for the business, not the syntax.) )】

"Error Handling Phase" Report error message "Log source" report error message: level, wrong body, file, line number "" Error Log on: Open location "" Custom error handling mechanism: Log System "When this error occurs, it is not sent directly to PHP to trigger the error, but instead is referred to the script for processing "Set_error_handle () the level of the callback" level management "error: Notice/warning/error" "constant: To determine the report information for the level and to modify the information in the PHP configuration" PHP uses bit operations to manage error levels for each standard: E _notice, e_warning, E_error "" User-triggered typical error levels: E_user_notice (1024) etc. "

Ini_set (' Srror ', some great number corresponds to the binary all bits are 1 of the number);//indicates that all errors are reported

Error configuration in production environment and development environment: low level in production environment "page shows fewer errors, log full", development environment Level High "page display all errors, log does not turn on" "Two different environments configured is different configuration files" in their own framework system to initialize the configuration, Automatic configuration according to different environments "because different systems often determine the environment, the environment is determined according to the system and the information about the error message is branched. To implement automatic configuration settings "

"Due to the resolution sequence of custom errors and system errors, the following occurs:" Once the user-defined processor is set, the system's reports and logs do not work. However, after the user's error handler returns false, the error mechanism is then handed over to the system's processor to implement a "fatal error that will cause the system to stop executing." A user-defined fatal error does not stop the script, but the system's fatal error itself cannot be customized by the user "

Pagination, picture watermark, thumbnail image processing tool class, PHP error mechanism

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.