PHP Interface Development Considerations

Source: Internet
Author: User

PHP Interface Development Considerations
    1. Pre-defined interface processes and logic to confirm requirements

      Identify processes before development, complex interfaces can draw flowcharts, and ensure processes are consistent with requirements;

    2. Use a uniform variable definition

      Both the SDK and server are dependent on the definition of the same variable and the settings of the global variable. The purpose is to facilitate maintenance

    3. Perfect exception handling mechanism

      Interface is to provide services to the outside, once the abnormal impact of large, and even affect the security of the system. Therefore, a set of perfect exception handling mechanisms is needed. For functions such as file_get_contents and fsocket, such as a common network connection timeout, you need to use @ To suppress the error output

    4. Unified Message Output format

      The output of the unified format will be largely user-friendly

    5. Compatibility of the SDK

      Fully consider the compatibility of the SDK, not all users of the environment are 5.3, not all environments support curl. The worst consideration is prompting the user to install the Curl extension. The PHP version limit can be at least 5.0, do not use their unfamiliar functions, especially the PHP version is dependent on the

    6. Friendly Error Hints

      Error alerts should be optimized for user data, regardless of whether the service is working properly

    7. Security mechanisms

      Strict filtering of user input data to avoid the security problems of service

    8. Service High Availability

      Many businesses rely on service interfaces, so high availability of interfaces is essential, and monitoring interfaces should be established to detect and eliminate the interfaces on which the services depend.



From for notes (Wiz)

PHP Interface Development Considerations

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.