PHP extensions and Embedding--Master _php Tutorial

Source: Internet
Author: User
Tags php language learn php php debugger
Initial contact with PHP development and PHP extension related content, found extending and embeded php This book is very good, a lot of questions are also very thorough. Here to read some of the contents of the book and their own practice together to show, both to keep their files, but also to look forward to the guidance of PHP Daniel.

Extending and embeded PHP This book also has a Chinese version, some things new, you can also refer to the following:
Http://www.walu.cc/phpbook/preface.md

This book is mainly about two aspects:
  • How to extend PHP by adding functions, classes, resources, and streams

  • How to embed the PHP language in other applications why do I need PHP extensions? :
    • A script that connects additional libraries and provides the user space in the form of an API . Like the packaged MySQL.
      • is to provide an extension between the third-party library and the core of PHP, so PHP is known as the glue language
      • for special internal operations, such as declaring a super variable , user space is restricted for security reasons. PHP's Advanced PHP debugger and Runkit, for example, are mostly doing this.
      • speed reason : token, compile, run, opcode can reduce the first two steps, but it is better to do this step to C code.
      • provides functionality without exposing the source code
        The overall structure of PHP is given in:

        The functions of each part of the module are as follows:
        SAPI: Is the interface layer with the Web server PHP Core: For the core event of the connection layer, processing similar to file processing, error handling such operations Zend Engine: The script compiled into machine language, execute bytecode, read into write user space variables, control program flow, Parse the extension. Tsrm:thread Safe Resource management: Enables a single PHP instance to have the ability to handle many separate requests simultaneously this book is divided into three parts, the first part is the re-introduction of PHP, the main description of how the PHP interpreter is bonded together. The second part is mainly about the extension of PHP, which involves the following aspects:
          • php API Some of the PHP internal functions and macros
          • How to convert the PHP script to C code: each PHP script behind the relevant C language processing, this correspondence is very useful for the development of extensions
          • Perform actions that are not possible for user space: There are many times when you need to do something like a super variable that cannot be done in a user state, and you need to use the extension for the appropriate processing. The third part is about how to embed PHP into the appropriate application:
            • First is to add the appropriate PHP support to the application
            • next is to take full advantage of PHP corresponding security features
            • finally explains how PHP handles multiple Request because just started to learn PHP, so some mistakes are unavoidable, please correct me.

              http://www.bkjia.com/phpjc/621630.html www.bkjia.com true http://www.bkjia.com/phpjc/621630.html techarticle preliminary contact with PHP development and PHP extension related content, found extending and embeded php This book is very good, A lot of questions are also very thorough. Here to read some of the contents of the book ...

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.