What PHP frameworks or tools have you written by yourself? Which PHP frameworks or tools have you written? Link
Reply content:
What PHP frameworks or tools have you written by yourself? Link
I have written a framework for my website. I have been using http://github.com/yeaha/lysine2 to process several dynamic requests every day.
- RESTful controller
- The built-in DataMapper ORM implementation is more convenient than ActiveRecord. the backend is not limited to relational databases, but can be easily switched to storage services such as mongodb, while the model api remains unchanged, it facilitates database sharding and table sharding
- Support layout views
- Mysql/postgresql/sqlite adapter
- Common cache redis/memcached adapter
- Log records
- Complete unit test
A total of 4616 lines of code, 168 K, the biggest problem is no documentation
Lysine2/src|-- class_files.php|-- context.php|-- core.php|-- curl.php|-- datamapper.php|-- error.php|-- functions.php|-- http.php|-- loader.php|-- logging.php|-- mvc.php|-- service| |-- amqp.php| |-- db| | |-- mysql.php| | |-- pgsql.php| | `-- sqlite.php| |-- db.php| |-- manager.php| |-- memcached.php| `-- redis.php|-- session.php`-- traits.php
Phploc statistics:
Size Lines of Code (LOC) 4616 Comment Lines of Code (CLOC) 203 (4.40%) Non-Comment Lines of Code (NCLOC) 4413 (95.60%) Logical Lines of Code (LLOC) 1567 (33.95%) Classes 1402 (89.47%) Average Class Length 23 Average Method Length 3 Functions 116 (7.40%) Average Function Length 4 Not in classes or functions 49 (3.13%)Complexity Cyclomatic Complexity / LLOC 0.40 Cyclomatic Complexity / Number of Methods 2.41Dependencies Global Accesses 28 Global Constants 2 (7.14%) Global Variables 3 (10.71%) Super-Global Variables 23 (82.14%) Attribute Accesses 432 Non-Static 411 (95.14%) Static 21 (4.86%) Method Calls 530 Non-Static 465 (87.74%) Static 65 (12.26%)Structure Namespaces 12 Interfaces 2 Traits 3 Classes 60 Abstract Classes 5 (8.33%) Concrete Classes 55 (91.67%) Methods 395 Scope Non-Static Methods 370 (93.67%) Static Methods 25 (6.33%) Visibility Public Method 314 (79.49%) Non-Public Methods 81 (20.51%) Functions 26 Named Functions 21 (80.77%) Anonymous Functions 5 (19.23%) Constants 55 Global Constants 5 (9.09%) Class Constants 50 (90.91%)
Https://gist.github.com/yeaha/672178
This is a code snippet that shows the storage service routing configuration, used to show how to shard
It will be used by mapper after configuration, completely transparent to the data model
I wrote a fewAlternativeFramework:
High-performance PHP Socket server framework workerman
PHP Thrift Rpc Remote Call framework workerman-thrift-rpc
PHP Json Rpc Remote Call framework workerman-json-rpc
PHP chat room framework workerman-chat
The above frameworks are all usedPHP DaemonRun without installing apache, nginx, and php-fpm.
WorkermanI use it to process hundreds of millions of order requests every day.
Should this post be a self-recommended post?
Previously, I liked fatfree routing control (to be honest, I didn't find any route control that I liked more than fatfree), but I also liked it because of database and template operations, so yesterday (or the day before yesterday ?) I did not write the fatfree routing function myself, but it is also unique (Github did not find the relevant project). Let's share it with the subject, project address: http://github.com/lizheming/F3router
For this part of the framework, we recommend two other things that I did not write myself (I really like you !). For database operations, we recommend Medoo and Twig for the template engine. However, in terms of templates, I prefer to use the native PHP syntax to write for what I use.
Because there are not many things in the framework, we can say that. For tools, I wrote a PHP static blog generator due to the popularity of Jekyll and Octopress. Very early, the exchange of blood several versions, has been updated, the Project address is: http://github.com/lizheming/pmblog
This is the only thing you can get. If you have any questions, please feel free to give feedback.
Recommended LitPHP
Recommendation reason: the number of lines of code in version 0.1 = 270 lines, rich expressiveness, free integration of any template/ORM solution, there are actual production projects
Official Website
Github Repo
Development Branch
Tutorial
Design Concept
PHP becomes a simple combination of power and complexity. In addition to organizing code and some routes, it does not have any functions and cannot be deleted. That is to say, any function is adapted by yourself to maintain 100% control, and any mode you like can be easily applied.
The framework of the framework enables every application to lie in a tailored framework.
Code:
Https://github.com/liaohuqiu/cube-php
Documentation:
Http://cube-php.liaohuqiu.net/
Things that have been in use over the past three years have been a hit in the business supported by this framework. The code is not fully organized yet.
I haven't written php for some time. Recently I 've been busy with it. I picked it up again and went out open-source. I thought about it and made a different souvenir.
- Implement standard autoload rules and allow various frameworks to access
- Database/table sharding
- Extremely simple Routing
- Dialog box, ajax request, client API request, ready for use in 5 minutes.
- A management background is provided.
- A js framework is provided.
Https://github.com/lloydzhou/router
A route controller with only 100 rows is not a framework.
Instead of using regular expressions for Route ing, you can create a tree structure based on pathinfo to ensure that the route search speed is stable in Olog (n ).
Supports hook, which can be used to filter parameters and check logon.
You can automatically retrieve variables based on the handler parameter list and use them with hooks. You no longer need to write the get post variable in full...