Yaf-lib yaf-based application PHP development framework

Source: Internet
Author: User
Yaf-lib yaf-based application PHP development framework yaf-lib yaf-based application development framework, simple mvc middle layer inheritance supplement, common cache, database and other driver classes, add widget component modules, and layout plug-ins, rpc service, support for hprose, yar, and so on, support for xhprof performance debugging.

Requirement
  • Php 5.3 +

  • Php-yaf 2.3.3

  • Phpredis 2.2.7

  • Memcache 2.2.7

  • Zmq 1.1.2

  • Xapian-bindings 1.2.21

  • Scws 1.2.2

  • Swoole 1.7.17

  • Hprose-php 1.5.4

  • Php-yar 1.2.4

  • Xhprof 0.9.4

Src/controllers Madclient

Http: // localhost/madclient Madclient is the client of the MadzMQ message queue implemented by php. it communicates with the madbroker through the msg protocol and sends messages asynchronously.

Src/bootstrap

Bootstrap is the yaf bootstrap program, which is split here. if the working web enters cgi mode, if the working web enters cli mode.

Src/library Controller

The Controller class inherits Yaf_Controller_Abstract, and the Controller can inherit this class selectively. it implements layout, widget, and other initialization in the class.

Sontroller

The Sontroller class inherits Yaf_Controller_Abstract and works in cli mode.

Model

The Model class is an abstract class of the data layer. all data objects can inherit from it. The Model can distribute data from different data_centers.

Widget

The Widget class is the base class of the component. the component class under the widgets directory inherits it, and the widgets/views directory is the view of the corresponding component. Call components through the $ widget method in views

$widget('IndexWidget',    array('class_key'=>'item_condition',        'output'=>'html',        'query'=>array(),        'assist_data'=>array(            'one'=>'one'        )    ));
Zmq_Msg

Zmq_Msg is a simple msg Message Protocol php implementation based on ZeroMQ.

Zmq_Kvmsg

Zmq_Kvmsg is a simple key-value message protocol php implementation based on ZeroMQ.

Core_Processpool

The Core_Processpool class encapsulates a process pool.

System_Mongo

The System_Mongo class encapsulates the mongodb client interface.

  • Conn is used to connect mongo

  • SelectDB select database

  • SelectCollection select document

  • FindOne obtains a data record.

  • Find

  • Select data can be sorted or range

  • Insert to add data

  • Update data

  • Close () close the connection

System_Socket

System_Socket class encapsulates network socket

System_Memcache

The System_Memcache class encapsulates the client interface of Memcached.

  • : Set to set cache

  • : Get cache

  • : Delete cache

  • : Flush clear

  • : Increment atomic count Plus

  • : Decrement atomic count subtraction

System_Redis

System_Redis class encapsulation redis client driver

System_Mysqlpdo

The System_Mysqlpdo class encapsulates the pdo_mysql operation interface.

  • : Bind

  • : Bindmore

  • : Query

  • : LastInsertId

  • : Column

  • : Row

  • : Single

System_Log

The System_Log class encapsulates the log processing class.

System_Sort

The System_Sort class encapsulates some classic sorting algorithms.

  • : Insertion insert sorting

  • : Selection select sorting

  • : Bubble sorting

  • : Merge sorting

Search_Segment

Search_Segment Chinese word segmentation

  • Init splitter initialization

  • Close

  • Query to obtain the original data list

  • QueryOne gets a single original data

  • CutQuery split original data

  • CutString split string

Search_Index

The Search_Index class is used to add an index.

  • SetIdPrefix

  • Add create index data

  • Alert Updates index data

  • Delete index data

Search_Match

The Search_Match class is used to match the search results.

  • Call Execution matching

Search_Database

The Search_Database class is used to query the original data in the index database.

  • Get_doccount

  • Get_data get the original data of a single document

  • Get_termlist

  • Select to obtain the data list

Search_Config

The Search_Config class can process search results based on configurations.

  • GetApp get app

  • GetAppName: Get the app name

  • GetTableName

  • FormatTitle formatting title

  • FormatDetail formatting details

  • FormatUrl format address bar

  • FormatImage format

Bin main

Server Program, locate MainController according to the name of the entrance file, and then execute the mainAction method. the CLI mode Portal file of yaf can develop powerful server programs in CLI mode.

./bin/main
Madserver

Madserver is the server of the MadzMQ message queue implemented by php. as a subscriber, madserver subscribes from madbroker. the protocol is kvmsg.

./bin/madserver
Hprose_swoole_tcp.php

The rpc service and tcp protocol support methods, object methods, and asynchronous call object methods:

// Server code $ server-> add (new TestModel (), '', 'test'); // The client calls $ client-> test-> one ();
Src/tools xapian
  • Xapian-bindings 1.2.21

Xhprof
  • Xhprof-0.9.4

Hprose-php
  • Hprose-php 1.5.4

Official website:Http://www.open-open.com/lib/view/home/1451381728995

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.