PHP API Project Open source

Source: Internet
Author: User
As a phper has not written anything decent PHP stuff. share an API's demo source code. This demo also accesses two databases.

Developed based on the php5.5. 5.3 There should be a lot of unsupported places.
Take a look at some of the mainstream MVC frameworks and then combine your own ideas to remove the V. A single entry file is not used.
Composer Loading class files
Monolog Open Source Code

1. Cache: Caches the folder, which caches the database's field data by default.
2. config: Configure the folder.
3. Controller: Although the name is the director, but the inside is the storage of multiple entry files.
4. Core: Kernel code.
5. lang: Verify the error message template.
6. Model: Models.
7. Vendor:composer

There's no perfect place
1. No character set filtering, and anti-injection function. (The PDO driver has its own anti-injection function as long as the field length is reasonably defined.) The most important thing is to be careless about it, so I didn't write this. Hope to know later can write it out)
2. Only one PDO driver was written. (Online a lot of out-of-the-box interface, you can directly take over to change can be used, more than the perfection of their own writing too much.) )
3. Did not go to complete the log system, because I think the development of the usual use of error and warning. (I define a variety of different exception to be thrown, receive in the portal file, and then write the log.) Following

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

4. There are many other features that are not considered or are not, or are not written to understand.

The nonsense is not much to say, directly on the code, the code I made a lot of comments:
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); }); });

    The above describes the PHP API project open source, including aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • 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.