Herosphp 3.0.1 released, lightweight php open source framework

HerosPHP is a free open source, fast and elegant object-oriented lightweight PHP MVC development framework. Using her, you can quickly build simple, easy-to-extend web applications. The initial version began in 2013. Full development documentation is available in 2016. Currently the latest version is v3.0.1.

Herosphp has the following features:

    1. Simple deployment, high development efficiency and high performance

    2. The framework is simple and practical, fool-style development, low learning threshold

    3. Maintain good scalability under the principle of keeping the convention greater than the configuration

    4. The code style is concise and beautiful, the program is streamlined and efficient, but the comments are detailed, suitable for novices to learn.

Function:

  • Full MVC support

  • Powerful database operation function

  • Perfect AOP support, listeners can be set separately in the application and module, and the aspect programming can be easily completed

  • Provides a large number of string tools, network tools, QR code tools, file processing, image uploading, cache tools, synchronization locks, etc., which can easily generate distributed unique IDs, RSA encryption, QR codes, etc.

  • The built-in code generation tool can easily generate model (M), service (S) and controller (C), and one name can complete the creation of database to generate controller code.

  • composer and psr-4 standard support

  • .....

Contents of this update:

  1. Fixed the bug of MysqlQueryBuilder::addWhere method, when the third parameter is not passed in, the query reports an error.

  2. Fix JsonResult::output output log garbled bug.

  3. Updated the algorithm for generating distributed unique IDs in the StringUtils class, changing 32 bits to generate 18-bit hexadecimal numbers

  4. Important: The skinUrl() interface has been added to the listener (Listener), which is used to filter request URIs that do not need to be monitored

How to use: Just call the skipUrl method in beforeRequestInit() in ModuleListener (module listener) or DefaultWebappListener (global listener). The url address supports wildcards, use "**"


class DefaultWebappListener extends WebApplicationListenerMatcher implements IWebAplicationListener {

     /**
      * 请求初始化之前
      * @return mixed
      */
     public function beforeRequestInit()
     {
         //设置跳过监听的uri, 比如登录页面,注册页面等
         $this->skipUrl("/user/**"); //跳过用户模块下所有请求
         $this->skipUrl("/admin/login/**"); //跳过登录控制器所有请求
         $this->skipUrl("/admin/scode/index"); //跳过验证码请求

         // TODO: Implement beforeRequestInit() method.
     }

     /**
      * action 方法调用之前
      * @return mixed
      */
     public function beforeActionInvoke(HttpRequest $request)
     {
        echo "捕获请求";
     }

     /**
      * 响应发送之前
      * @return mixed
      */
     public function beforeSendResponse(HttpRequest $request, $actionInstance)
     {
         $webApp = WebApplication::getInstance();
         //注册当前app的配置信息
         $actionInstance->assign('appConfigs', $webApp->getConfigs());
         $actionInstance->assign('params', $webApp->getHttpRequest()->getParameters());
     }

     /**
      * 响应发送之后
      * @return mixed
      */
     public function afterSendResponse($actionInstance)
     {
         // TODO: Implement afterSendResponse() method.
     }

}


online demo

http://herosphp.r9it.com





Guess you like

Origin blog.csdn.net/yangjian8801/article/details/78246412