search
Homephp教程php手册Minor [PHP Framework] 1. Introduction, introduction to minorphp framework

Minor [PHP Framework] 1. Introduction, introduction to minorphp framework

1.1 What is Minor

Minor is a simple but excellent PHP framework. It just did what a framework should do. It just does what a framework should do. It is simple but powerful!

Framework Github address: github.com/Orlion/Minor

 (If you think it’s good, give it a star (^-^)V)

Author: Orlion

Zhihu: https://www.zhihu.com/people/orlion

Github: https://github.com/Orlion

 

What’s in 1.2 Minor

 1.2.1 Minor mainly provides:

 

 1.2.2 Why does Minor only provide so few things?

Most of the current PHP frameworks are very bloated and provide various functions. In my opinion, this is just reinventing the wheel (although writing frameworks is also reinventing the wheel...). The framework only needs to provide users with a shelf and Just a few tools are enough. Users should not be given a lot of things (a lot of repetitively reinvented wheels). Users should not be tied up but given great freedom. This will also make it easier for users to get started. Personally, I think Java's Spring framework is a very good framework. It's simple enough, powerful enough, and small is beautiful! Minor is a framework born under this idea. Without all kinds of messy paging, ORM, template engine, log, queue and other functions, it is just a pure "shelf".

 1.2.3 Advantages

Hurry! High performance! Simple! Easy to get started! Clear structure!

Small is beautiful!

1.3 Installation

Just git clone from github (github.com/Orlion/Minor) or directly copy the zip package and unzip it into the project.

The Minor framework sets <span class="token keyword">public<span class="token operator">/<span class="token punctuation">.htaccess<code class=" language-php"><span class="token keyword">public<span class="token operator">/<span class="token punctuation">.htaccess</span></span></span>index<span class="token punctuation">.php</span>mod_rewrite file removes index<span class="token punctuation">.php</span>

from the link. If your server is using Apache, make sure to enable the

module.

location /<span> {
    try_files $uri $uri</span>/ /index.php?<span>$query_string;
}</span>
If it is an Nginx server, put the following instructions in the configuration file of the URL:

In this way, when you visit http://localhost/public/, you can see the successful installation screen. (Of course you can also configure it to remove public)


How the 1.4 Minor works


 1.4.1 Overall process

Take the URL http://www.servername.com/demo/test as an example:

 

1.4.2 How App handles requests
<span>   public</span> <span>function</span> handle(MinorRequest <span>$minorRequest</span><span>)
    {
        </span><span>$minorResponse</span> = MinorResponse::<span>getInstance();

        </span><span>$this</span>->minorRequest = <span>$minorRequest</span><span>;

        </span><span>list</span>(<span>$controllerName</span>, <span>$actionName</span>, <span>$params</span>) = <span>$this</span>->router->dispatcher(<span>$minorRequest</span>-><span>getUrl());

        </span><span>if</span> (!(<span>$controllerName</span> && <span>$actionName</span> && <span>is_array</span>(<span>$params</span><span>))) {
            </span><span>if</span> (!Config::get(['app' => 'DEBUG']) && (<span>$handler</span> = Config::get(['app' => '404_HANDLER'])) && (<span>$handler</span><span> instanceof \Closure)) {
                </span><span>$handler</span>(<span>$minorRequest</span>-><span>getRequestUrl());
            } </span><span>else</span><span> {
                </span><span>throw</span> <span>new</span> RouteException('404 Not Found'<span>);
            }
        } </span><span>else</span><span> {
            </span><span>$minorResponse</span> = <span>$this</span>->invoke(<span>$controllerName</span>, <span>$actionName</span>, <span>$params</span><span>);
        }

        </span><span>return</span> <span>$minorResponse</span><span>;
    }</span>

1.5 Please ignore the above bragging field

Yeah! Just please ignore it. Don’t blame me for not reminding you

 
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version