CN107766037A - MVC frameworks based on PHP - Google Patents

MVC frameworks based on PHP Download PDF

Info

Publication number
CN107766037A
CN107766037A CN201710989812.7A CN201710989812A CN107766037A CN 107766037 A CN107766037 A CN 107766037A CN 201710989812 A CN201710989812 A CN 201710989812A CN 107766037 A CN107766037 A CN 107766037A
Authority
CN
China
Prior art keywords
php
unit
layer
display layer
rflib
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710989812.7A
Other languages
Chinese (zh)
Inventor
齐琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN201710989812.7A priority Critical patent/CN107766037A/en
Publication of CN107766037A publication Critical patent/CN107766037A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention proposes a kind of MVC frameworks based on PHP, including:PHP application modules and RFlib storehouses, the RFlib storehouses include:Payment platform interface unit, PHPExcel units, WebService units, Mailing List member, Quick Response Code unit, page static unit and template engine unit, Intelligent housing unit, event task push unit, short message sending unit, journal processing unit, the template engine unit is based on Smarty and completes PHP templates and developed based on RF tag definitions template engine, and the PHP application modules specifically include:Model layer, display layer and key-course, the model layer is connected to RFlib storehouses, the display layer is connected to model layer, the key-course is connected to model layer and display layer, the model layer provides bottom data source interface for display layer, Various types of data filling template, formation HTML are presented to terminal user by the display layer.The present invention has the advantages of being easily used, be safe, distributed good and execution efficiency is high.

Description

MVC frameworks based on PHP
Technical field
The present invention relates to computer software programming technical field, more particularly to a kind of MVC frameworks based on PHP.
Background technology
PHP is in server end execution script language, and it is excellent to have that easy to use, execution efficiency is high and professional platform independence is good etc. Point, it is one of Web development languages most popular at present.Web exploitations are sent to server indeed through by HTTP request Script is held, data management is carried out to database by server side scripts.Web frameworks be in Web system server script with And the organizational form of HTTP request.
MVC is a kind of Web frameworks based on controller/action, and it parses HTTP request usually using a routing module, And appropriate controller (or some action in controller) is called to handle request.MVC pattern by mask data, Logical sum shows, by the data processing in Web system, Row control and data display it is enforceable be divided into model, controller and View three parts.MVC pattern requirement implementation model and controller in the script in cross-page face communicate.
However, there is following defect in the MVC frameworks for being currently based on PHP:
1st, because PHP object is recovered after the page is finished, thus PHP object can not cross-page face exist, tradition MVC frameworks can not be fully achieved on PHP.General solution is that object is stored in into database or SESSION before recovery In, it is necessary to when in the reconstructed object from database or SESSION.This mode is due to needing frequently read-write database, it is clear that effect Rate is more low.
2nd, in PHP Web exploitations, Web projects expand the great number of issues brought, Front-end Design team and programming group Cooperation, the control of maintenance and expansion difficulty of team are two big difficult points.
3rd, Development Framework needs in systems to be separated from each other service logic and data, and typically uses data access layer Program is separated with database, data access layer typically realizes the separation of logical sum data using data relationship mapping (ORM), and ORM is mapped in database using the relation between metadata description object and database.Due to program object and relation number It is complex according to the mapping in storehouse, therefore can cause than more serious efficiency reduction.
The content of the invention
The purpose of the present invention is to propose to a kind of MVC frameworks based on PHP, can have and be easily used, be safe, be distributed The advantages of good and execution efficiency is high.
To reach above-mentioned purpose, the present invention proposes a kind of MVC frameworks based on PHP, including:PHP application modules and RFlib storehouses, the RFlib storehouses include:Payment platform interface unit, PHPExcel units, WebService units, mail are sent Unit, Quick Response Code unit, page static unit and template engine unit, Intelligent housing unit, the push of event task are single Member, short message sending unit, journal processing unit, the template engine unit are based on Smarty and complete PHP template developments and base Developed in RF tag definitions template engine, the PHP application modules specifically include:Model layer, display layer and key-course, the mould Type layer is connected to RFlib storehouses, and the display layer is connected to model layer, and the key-course is connected to model layer and display layer, The model layer provides bottom data source interface for display layer, and Various types of data filling template, formation HTML are in by the display layer Terminal user is now given, the key-course is used to coordinate and manage model layer and display layer, and extraction process model layer data is provided to Display layer uses.
Further, in the MVC frameworks based on PHP, the RFlib storehouses also include:Thumbnail unit, for base Realize that PHP generates thumbnail function in SimpleImage.
Further, in the MVC frameworks based on PHP, the RFlib storehouses also include:International Support unit, use Supported in providing I18N.
Further, in the MVC frameworks based on PHP, the payment platform interface unit includes:For with the 3rd The docking encapsulation of Fang Pingtai payment interfaces.
Further, in the MVC frameworks based on PHP, the page static unit realizes the page based on Curl Capture and generate static page.
MVC frameworks of the invention based on PHP include the bottom functions such as the parsing of processing PHP catalogues, data source connection, are PHP Application layer research and development provide good driving and supported, have and are easily used, are safe, be distributed good and high execution efficiency excellent Point.
Brief description of the drawings
Fig. 1 is the structural representation of the MVC frameworks of the invention based on PHP;
Fig. 2 a are schematic diagram of the MVC frameworks of the invention based on PHP in the first application scenarios embodiment;
Fig. 2 b are schematic diagram of the MVC frameworks of the invention based on PHP in the second application scenarios embodiment;
Fig. 2 c are schematic diagram of the MVC frameworks of the invention based on PHP in the 3rd application scenarios embodiment;
Fig. 2 d are schematic diagram of the MVC frameworks of the invention based on PHP in the 4th application scenarios embodiment.
Embodiment
The preferred embodiment that the invention will now be described in detail with reference to the accompanying drawings.
Referring to Fig. 1, the MVC frameworks (i.e. RainFramework, RF) of the invention based on PHP include:PHP application modules 1 And RFlib storehouses 2.
Wherein, RFlib storehouses 2 are PHP MVC LIB (BCL), and it is in the Development Framework bottom, are PHP application modules Research and development provide driving and supported, comprising bottom functions such as the parsing of processing PHP catalogues, data source connections, and are opened comprising PHP popular softwares Component bag is sent out, and good scalability is provided.
Wherein, the RFlib storehouses 2 include:Payment platform interface unit, PHPExcel units, WebService units, postal Part transmitting element, Quick Response Code unit, page static unit and template engine unit, smart home processing unit (curtain, electricity Lamp, door lock, air-conditioning, router control), event task (JPuush) push unit, short message sending unit, journal processing unit. The payment platform interface unit includes:Head letters are easily paid, China Unionpay, can realize related payment function by two interfaces Research and development, if the docking of other third-party platform payment interfaces need to be carried out, such as Alipay, wealth, which are paid, to be led to, and need to only be connect third-party platform Mouth carries out secondary encapsulation and is put into LIB storehouses.
The PHPExcel units include functional, the versions (V1.7.8) of PHPExcel;The WebService
Unit is based on Nusoap, realizes PHP issues, request WebService functions, but unless special circumstances, it is not recommended that make WebService programmings are carried out with soap protocol, itself belongs to heavyweight protocol, it is contemplated that Rest modes;The mail hair Unit is sent to realize PHP e-mail transmitting functions based on PHPmailer;The Quick Response Code unit realizes PHP Quick Response Codes based on Qrcode Function;The page static unit realizes that the page captures and generates static page based on Curl.
The template engine unit is based on Smarty and completes PHP template developments, realizes that display layer separates.Separator page designs It is maximally effective solution with programmed logic.In PHP Web exploitations, generally use mould plate technique separation display and logic. Corresponding to MVC, template analytics engine is generally in view layer.Template analytics engine provides relatively simple template instruction, with branch Hold Front-end Design personnel and write html template.Template analytics engine can say that html template is directly run after being compiled into PHP scripts.
The RFlib storehouses also include:Thumbnail unit, for realizing that PHP generates thumbnail work(based on SimpleImage Energy.
The RFlib storehouses also include:International Support unit, supported for providing I18N.
The RFlib storehouses are MVC class library files, generally, forbid making it any modification, except no special feelings Condition.
In the present embodiment, the RFlib library directories structure is as follows:
PHP MVC LIB
PHP MVC class libraries bibliographic structures are as follows:
The PHP application modules 1 are .PHP Appliction (application layer), and it is research staff's development and application program layer, The core logic code of application program is wherein included, application layer is realized using MVC frameworks.
The PHP application modules 1 specifically include:Model layer (Model layers) 12, display layer (View layers) 14 and key-course (Ctroller layers) 16, the model layer 12 are connected to RFlib storehouses 2, and the display layer 14 is connected to model layer 12, the control Layer 16 is connected to model layer 12 and display layer 14, wherein, the model layer 12 is that the offer bottom data of display layer 14 source connects Mouthful, wherein data source mainly includes:Database, XML, caching, third party's data etc.;The display layer 14 fills out Various types of data Mold filling plate, form HTML and be presented to terminal user;The key-course 16 is used to coordinate and manage model layer 12 and display layer 14, extracts The processing data of model layer 12 are provided to display layer 14 and used.
Based on PHP object can not present situation existing for cross-page face, the PHP application modules 1 are more closed using passive MVC pattern Reason.In passive MVC, model exists in the form of plain objects, is not associated with the other parts of MVC structures.So both may be used The problem of avoiding object cross-page face, avoid the efficiency that MVC pattern is brought and decline.
In the present embodiment, it is as follows that the display layer 14 develops bibliographic structure:
Catalogue can be voluntarily established under each catalogue, directory name requirement must be lowercase form
File name uses English full form all using lowercase, and what file name to be taken acts on file Unanimously, such as:Index.php, getuser.php, it is (as static in generated with numeral that underscore can be included in special circumstances filename Page).
Web catalogues are copied to below webroot, this catalogue is display layer file, and what user accessed is this catalogue.
The exploitation bibliographic structure of the model layer 12 and key-course 16 is as follows:
It should be noted that Action is key-course catalogue, its lower file is created according to module title, wherein building Vertical each action initials small letter, suffix is terminated with Action, such as indexAction.php.
Dao is model layer catalogue, and its lower file creates according to module title, wherein each dao lead-ins capitalization established Terminated with Dao, such as:UserInfoDao.php.
Common is customized utility class or function file beyond Action and Dao.
It is entirely English alphabet that the model layer 12 and the directory name of key-course 16, which require, and initial is necessary for capitalizing, such as Followed by remaining word, it is desirable to remaining word initial caps, remaining small letter.
Fig. 2 a to Fig. 2 d are please referred to respectively, and it is respectively that the MVC frameworks of the invention based on PHP are implemented in four application scenarios The schematic diagram of example.
For Fig. 2 a the first application scenarios, initial page is without Action (A):It need not be done before page loading any Flow processing;Jump page includes Action (B):Page B needs service logic before loading, as data check, authority are sentenced It is disconnected, the operation such as data initialization.
For Fig. 2 b the second application scenarios, initial page includes Action (A):Business is needed to patrol before page loading Volume, as data check, authority judge that data initialization etc. operates;Jump page includes Action (B):B patrols without any business Volume.
For Fig. 2 c the 3rd application scenarios, initial page includes Action (A):Business is needed to patrol before page loading Volume, such as operations such as authority judgement, data initializations;Jump page includes Action (B):Page B is equally also wrapped before loading Containing specific business processing logic.
For Fig. 2 d the 4th application scenarios, initial page includes or not comprising Action (A):I.e. can before page loading To there is service logic also not have.Without jump page (B):That is A initiate request after need not the property entered page jump, typically occur in When Ajax is called.
It should be noted that no matter above-mentioned Action Business Process Controls file needs in initial page, or jump page Included in page top.
In addition to the 4th application scenarios, Action files create in the form of RFweb/ modules/xxxAction.php, and XxxAction.php is included into jump page.
For the 4th application scenarios, when calling Ajax, simple Business Process Control can be in web/ modules/ajax/xxx.php Interior completion;Ajax for possessing complex logic, after first can creating Action in the form of RFweb/ modules/xxxAction.php, Completed by quoting xxxAction.php in web/ modules/ajax/xxx.php.
Compared to prior art, the MVC frameworks of the invention based on PHP have be easily used, be safe, autgmentability is strong, The advantages of distribution is well and execution efficiency is high:
1st, ease for use:MVC frameworks of the present invention are easily used, and learning cost is low (must possess Target-oriented thought), level Clearly, application layer development mode is unified, can preferably carry out team collaboration's research and development.Programmed according to specification, the later stage can automatically generate The Document of code.
2nd, security:MVC frameworks of the present invention ensure that data plane security, be accessed using PDO as database security Web catalogues are only exposed to HTTP, other catalogues have no right to access by HTTP, ensure that by interface, application program in deployment Application layer security.In terms of other securities it is the same with other third party's frameworks, it is necessary to by Web server and code quality come Ensure.
3rd, autgmentability:Loosely coupled is realized between MVC frame assemblies of the present invention, module, i.e., between component independently of each other simultaneously Final composition RFlib frameworks.This mode is advantageous to framework extension.
4th, it is distributed:The RFlib storehouses of MVC frameworks of the present invention can be according to application program module distributed deployment, will be different Functional module or channel are deployed to single server, mitigate integrity service device and access pressure.
5th, execution efficiency:The RFlib storehouses execution efficiency of MVC frameworks of the present invention is better than other third party's frameworks, and reason is as follows:
A, using non-single entry
Single entry file is in the case of program high concurrent, poor efficiency, and all requests are required for access entrance file, first First page pressure is big, if secondly having database manipulation in entry file, it is overweight equally to also result in database pressure so that whole Individual system operation is slow.
B, multiple entry file advantage is, different user's requests is distributed into the different pages is handled, and greatly alleviates page Face loads and database loads.
C, primary PHP
RFlib frameworks are write using primary PHP, to be handled by programs such as any compiling, explanation, routes, at utmost On ensure that execution efficiency.
MVC frameworks of the present invention on the basis of main flow Web frameworks are analyzed, it is safe efficient, stably, it is easy-to-use on the premise of, Reduce the ecosystem of PHP language;PHP exploitations, several major techniques that this framework frame is related to are designed in a manner of loose coupling: MVC design pattern, template analytics engine and data access layer and its main way and advantage and disadvantage realized in PHP, based on it The characteristic of loose coupling itself, it is very easy to carry out the extension of periphery, gives based in passive MVC, template analytic technique, SCWS Literary participle technique, REDIS caching process, and the data access layers of Table Data Gateway patterns realize lightweight The solution of PHP Development Frameworks.
To sum up, the MVC frameworks of the invention based on PHP include the bottom functions such as the parsing of processing PHP catalogues, data source connection, There is provided good driving for the research and development of PHP application layers to support, have be easily used, be safe, distributed good and execution efficiency height The advantages of.
Here description of the invention and application are illustrative, are not wishing to limit the scope of the invention to above-described embodiment In.The deformation and change of embodiments disclosed herein are possible, real for those skilled in the art The replacement and equivalent various parts for applying example are known.It should be appreciated by the person skilled in the art that the present invention is not being departed from Spirit or essential characteristics in the case of, the present invention can in other forms, structure, arrangement, ratio, and with other components, Material and part are realized.In the case where not departing from scope and spirit of the present invention, embodiments disclosed herein can be entered The other deformations of row and change.

Claims (5)

  1. A kind of 1. MVC frameworks based on PHP, it is characterised in that including:PHP application modules and RFlib storehouses, the RFlib storehouses bag Include:Payment platform interface unit, PHPExcel units, WebService units, Mailing List member, Quick Response Code unit, the page Static unit and template engine unit, Intelligent housing unit, event task push unit, short message sending unit, daily record Processing unit, the template engine unit are based on Smarty and complete PHP template developments and based on RF tag definition template engines Exploitation, the PHP application modules specifically include:Model layer, display layer and key-course, the model layer are connected to RFlib storehouses, institute State display layer and be connected to model layer, the key-course is connected to model layer and display layer, and the model layer carries for display layer For bottom data source interface, Various types of data filling template, formation HTML are presented to terminal user, the control by the display layer Layer is used to coordinate and manage model layer and display layer, and extraction process model layer data is provided to display layer use.
  2. 2. the MVC frameworks according to claim 1 based on PHP, it is characterised in that the RFlib storehouses also include:Thumbnail Unit, for realizing that PHP generates thumbnail function based on SimpleImage.
  3. 3. the MVC frameworks according to claim 2 based on PHP, it is characterised in that the RFlib storehouses also include:Internationalization Supporter, supported for providing I18N.
  4. 4. the MVC frameworks according to claim 2 based on PHP, it is characterised in that the payment platform interface unit bag Include:For docking encapsulation with third-party platform payment interface.
  5. 5. the MVC frameworks according to claim 1 based on PHP, it is characterised in that the page static unit is based on Curl realizes that the page captures and generates static page;
    Static unit realizes that the page captures and generates static page based on Curl;
    Reach Cloud Server and generate corresponding Quick Response Code, and Dicom image datas corresponding to the identification Quick Response Code download.
CN201710989812.7A 2017-10-23 2017-10-23 MVC frameworks based on PHP Pending CN107766037A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710989812.7A CN107766037A (en) 2017-10-23 2017-10-23 MVC frameworks based on PHP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710989812.7A CN107766037A (en) 2017-10-23 2017-10-23 MVC frameworks based on PHP

Publications (1)

Publication Number Publication Date
CN107766037A true CN107766037A (en) 2018-03-06

Family

ID=61269080

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710989812.7A Pending CN107766037A (en) 2017-10-23 2017-10-23 MVC frameworks based on PHP

Country Status (1)

Country Link
CN (1) CN107766037A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228166A (en) * 2018-03-15 2018-06-29 链家网(北京)科技有限公司 A kind of back-end code generation method and system based on template
WO2019210523A1 (en) * 2018-05-04 2019-11-07 深圳晶泰科技有限公司 Universal force field database and updating method and retrieval method therefor
CN110543294A (en) * 2019-08-16 2019-12-06 上海易点时空网络有限公司 MVC framework system
CN112947911A (en) * 2021-04-26 2021-06-11 平安普惠企业管理有限公司 Interface script generation method, device, equipment and storage medium
CN115934043A (en) * 2023-01-04 2023-04-07 广州佰瑞医药有限公司 PHP-based high-efficiency MVC framework

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100087860A (en) * 2009-01-29 2010-08-06 주식회사 로코드 A mobile web application framework, mobile terminal, and, a storage medium
CN103513966A (en) * 2012-06-15 2014-01-15 北京力美科技有限公司 PHP developing framework based on assemblies
CN105447760A (en) * 2015-11-13 2016-03-30 广东网金控股股份有限公司 Templatizing and configuring method for standardized investing and financing transaction system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100087860A (en) * 2009-01-29 2010-08-06 주식회사 로코드 A mobile web application framework, mobile terminal, and, a storage medium
CN103513966A (en) * 2012-06-15 2014-01-15 北京力美科技有限公司 PHP developing framework based on assemblies
CN105447760A (en) * 2015-11-13 2016-03-30 广东网金控股股份有限公司 Templatizing and configuring method for standardized investing and financing transaction system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
孟佟: "PHP开发框架的关键技术研究", 《通讯世界》 *
闫晓亮等: "MVC模式PHP开发框架", 《长春工业大学学报》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228166A (en) * 2018-03-15 2018-06-29 链家网(北京)科技有限公司 A kind of back-end code generation method and system based on template
CN108228166B (en) * 2018-03-15 2020-07-07 贝壳找房(北京)科技有限公司 Template-based back-end code generation method and system
WO2019210523A1 (en) * 2018-05-04 2019-11-07 深圳晶泰科技有限公司 Universal force field database and updating method and retrieval method therefor
CN110543294A (en) * 2019-08-16 2019-12-06 上海易点时空网络有限公司 MVC framework system
CN112947911A (en) * 2021-04-26 2021-06-11 平安普惠企业管理有限公司 Interface script generation method, device, equipment and storage medium
CN115934043A (en) * 2023-01-04 2023-04-07 广州佰瑞医药有限公司 PHP-based high-efficiency MVC framework
CN115934043B (en) * 2023-01-04 2024-03-15 广州佰瑞医药有限公司 PHP-based high-efficiency MVC framework

Similar Documents

Publication Publication Date Title
CN107766037A (en) MVC frameworks based on PHP
US20180357055A1 (en) System and method for computer language migration
CN101706716B (en) VO-based form customization, configuration and parsing operation method
CN101151608B (en) Ability for developers to easily find or extend well known locations on a system
CN108509185B (en) System and method for arbitrary software logic modeling
EP1437663A2 (en) Document composition system and method
CN101706720B (en) Method for showing interface according to customized information during operation
CN109117119A (en) A kind of polymorphic component fusion method
CN103425468B (en) Plug-in type software integrating method and device
CN110069246A (en) The plateform system and its application that a kind of Java Web application is quickly developed
CN102789382A (en) System and method for generating and running form
CN106201480A (en) A kind of cockpit display Control System Software architecture management platform
CN101984438A (en) Method of online self-help website establishment, creation of application service and development of online software
JP5926470B1 (en) Electronic file structure, computer-readable storage medium, electronic file generation device, electronic file generation method, electronic file
CN105183450A (en) E-government form model configuration system with foreground and background separation function
CN102163237A (en) Implementation method of loosely coupled flow
CN102646232A (en) High concurrence enterprise integrated application system
CN104517181A (en) Enterprise content management system and enterprise content management method for nuclear power plants
CN109445794B (en) Page construction method and device
CN108241902A (en) A kind of Web projects and performance optimization method
CN104123155B (en) A kind of operation system page layer development platform and method based on WEB
CN102722368B (en) Plug-in software designing method based on document tree and message pump
CN114048370A (en) Python-based archive file processing, storage and one-stop management platform
CN101000618A (en) Method and device for set-up disconnection data programmed model and its application
CN109144674A (en) Contract processing unit and contract processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180306