Open-source php api project

Source: Internet
Author: User
: This article mainly introduces the open-source php api project. if you are interested in the PHP Tutorial, refer to it. As a phper, I have never written any decent php stuff. Share The demo source code of an api. This demo simultaneously accesses two databases

Developed based on php5.5. 5.3 is probably not supported.
Refer to some mainstream mvc frameworks and then remove v based on your own ideas. No single entry file is used.
Composer loads class files
Monolog open source code

1. cache: cache folder. by default, the field data of the database is cached.
2. config: configure the folder.
3. controller: Although it is called a controller, it contains multiple entry files.
4. core: core code.
5. lang: validation error message template.
6. model: model.
7. vendor: composer

Not perfect
1. character set filtering and anti-injection are not performed. (As long as the field length is reasonably defined, the pdo driver has its own anti-injection function. The most important thing is that I did not write this because I did not understand it. I hope I can write it later)
2. Only one pdo driver is written. (There are many ready-made interfaces on the Internet, which can be used directly after modification. this is much more perfect than self-written interfaces .)
3. I didn't do a complete log system, because I think the common use of log system is error and warning. (I defined a variety of different exceptions to throw, receive them in the entry file, and then write logs. As shown below)

try {    ...} catch (AppException $e) {    ...} catch (Exception $e) {    ...}

4. there are many other functions, that is, they do not take into account or can not, or even do not understand the writing.

I didn't talk much about the nonsense. I directly wrote the code, and I made a lot of comments in the code:
Http://pan.baidu.com/s/1sjV4cc1

'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
  • '). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script

    The above introduces the open-source PHP api project, including some content, and hopes to help those who are interested in the PHP Tutorial.

    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.