Scan the QR code or click the picture to enter xi ‘an Yuanchuangfei registration

Biny is an ultra-lightweight PHP framework developed by Tencent.

Biny is an ultra-lightweight PHP framework developed by Tencent. Follow the MVC pattern for rapid development of modern Web applications. Biny code is simple and elegant, the application layer, data layer, template rendering layer encapsulation is easy to understand, can be used quickly. High performance, frame response time within 1ms, single QPS easily up to 3000.

The sample code

features

  • Support cross-library table, conditional compound screening, PK cache query, etc

  • Synchronous asynchronous request separation, automatic load management of classes

  • Support Form validation, support event triggering mechanism

  • Browser debugging is supported to quickly locate program problems and performance bottlenecks

  • With SQL anti – injection, HTML automatic anti – XSS features

The directory structure

  • /app/ Master working directory

  • /app/config/ Service configuration layer

  • /app/ Controller/Route entry Action layer

  • /app/ DAO/Database table instance layer

  • /app/event/ Event triggering and definition layer

  • /app/ Form /form definition and validation layer

  • /app/model/ Custom model layer

  • /app/service/ business logic layer

  • /app/template/ page rendering layer

  • /config/ framework configuration layer

  • /lib/ The system lib layer

  • /lib/vendor/ Customize the system lib layer

  • /logs/ work log directory

  • /plugins/ plugins directory

  • /web/ Total execution entry

  • /web/static/ static resource file

  • /web/index.php Total execution file

Call relationship

Action is the total routing entry, and Action can invoke the private object Service business layer and DAO database layer

The Service business layer invokes the PRIVATE object DAO database layer

The program can call system methods in the lib library globally, for example: TXLogger (debug component)

TXApp::$base is a global singleton class that can be called globally

TXApp::$base->request :$base->request :$base->request

TXApp::$base->session specifies the system session

$base->memcache = $base->memcache = $base->memcache

$base->redis :$base->redis :$base->redis

The user can customize the model data class under /app/model/ via TXApp::$model, for example:

TXApp::$model->person is the current user, which can be defined in /app/model/person.php

Environment configuration

The PHP version must be at least 5.5, including 5.5

If you need a database, you need to install and enable the mysqli extension

In the php.ini configuration, you need to enable short_open_tag

/config/autoload.php is the automatic loading configuration class and must have write permission

The /logs/ directory is the logging folder and must also have write permission

This example describes how to configure nginx in Linux

The nginx root directory needs to point to the /web/ directory as shown in the following example

The Apache configuration is as follows:

/web/index.php is the main entry point for the program, with several key configurations

The SYS_ENV environment value also has bool for easy judgment

Kotlin rules the world? Kotlin/Native started supporting iOS and Web development

Developers’ most hated programming languages: PHP, Ruby

Deployment, Testing and Application of Message-oriented Middleware Kafka + ZooKeeper Cluster (1)

Top 10 Open Source Technologies for High Income

Top 10 open source game frameworks recommended

“Read the original text”