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.