Minor [PHP framework] 1. introduction, minorphp framework introduction. Minor [PHP framework] 1. introduction: minorphp framework introduction 1.1Minor is a simple but excellent PHP framework, Itjustdidwhataframeworkshoulddo. only one framework should be Minor [PHP framework] 1. introduction: Introduction to the minorphp framework
1.1 What is Minor?
Minor is a simple but excellent PHP framework. It just did what a framework shocould do. Only one framework should be done, simple and powerful!
Github address: github.com/Orlion/Minor
(If you think it is not bad, give a star (^-^) V)
Author: Orlion
Know: https://www.zhihu.com/people/orlion
Github: https://github.com/Orlion
1.2 What is Minor?
1.2.1 Minor mainly provides:
1.2.2 why does Minor only provide such things?
Most of the current PHP frameworks are bloated and provide various functions. in my opinion, this is just a duplicate of the wheel (although the write framework is also a duplicate of the wheel ...), the framework only needs to provide users with a shelf and some tools. instead of providing users with a lot of things (a lot of repetitive wheels), users should not be bundled, but users should be given great freedom, this will also make it easier for users to get started. I personally think that the Spring Framework of java is a very good framework, simple enough, powerful enough, small is beautiful! Minor is the framework born under this idea. Without a variety of messy paging, ORM, template engine, logs, queues, and other functions, it is a pure "shelf ".
1.2.3 advantages
Fast! High performance! Simple! Easy to use! Clear structure!
Small is beautiful!
1.3 Installation
You only need to clone github (github.com/Orlion/Minor) or directly copy the zip package and decompress it to the project.
Set the Minor frameworkpublic/.htaccess
Remove files from linksindex.php
. If your server uses Apache, make sure thatmod_rewrite
Module.
If it is an Nginx server, place the following commands in the URL configuration file:
location / { try_files $uri $uri/ /index.php?$query_string;}
In this way, the installation is successful when you access http: // localhost/public. (Of course, you can also configure to remove public)
1.4 How Minor works
1.4.1 overall process
Take http://www.servername.com/demo/testas an example:
1.4.2 how the App processes the request
public function handle(MinorRequest $minorRequest) { $minorResponse = MinorResponse::getInstance(); $this->minorRequest = $minorRequest; list($controllerName, $actionName, $params) = $this->router->dispatcher($minorRequest->getUrl()); if (!($controllerName && $actionName && is_array($params))) { if (!Config::get(['app' => 'DEBUG']) && ($handler = Config::get(['app' => '404_HANDLER'])) && ($handler instanceof \Closure)) { $handler($minorRequest->getRequestUrl()); } else { throw new RouteException('404 Not Found'); } } else { $minorResponse = $this->invoke($controllerName, $actionName, $params); } return $minorResponse; }
1.5 ignore the above bragging fields
Well! Ignore it. Don't blame me for not reminding me
Protocol PHP Framework: 1. introduction, minorphp framework Introduction 1.1 what is Minor? Minor is a simple but excellent PHP framework. It just did what a framework shocould do. only one framework should be...