YAF-LIB Application PHP Development framework based on YAF

Source: Internet
Author: User
Tags delete cache
Yaf-lib based on YAF application Development framework, simple MVC middle tier inheritance supplement, common cache, database and other driver classes, add widget module, and layout plug-in, RPC service, support Hprose, Yar, etc., Support 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 a client of MADZMQ Message Queuing implemented by PHP, which communicates with Madbroker through the MSG protocol and asynchronously sends messages.

Src/bootstrap

Bootstrap is the YAF bootloader, which is split here if the work of the web goes into CGI mode, if the work goes into CLI mode at the command line.

Src/library

Controller

The controller class inherits the Yaf_controller_abstract, which can optionally inherit this class, implemented in classes, layout, widgets, and so on.

Sontroller

The Sontroller class inherits the Yaf_controller_abstract, which works in CLI mode.

Model

The model class is an abstract class of data layers that can be inherited by all data objects, and model can distribute data from different data_center.

Widgets

The Widget class is the base class for the component, and the component classes under the Widgets directory inherit it, and the Widgets/views directory is the view of the corresponding component. The component is called 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 PHP implementation of a simple MSG message protocol based on ZEROMQ

Zmq_kvmsg

Zmq_kvmsg is a PHP implementation of a simple Key-value message protocol based on ZEROMQ

Core_processpool

The Core_processpool class encapsulates a process pool.

System_mongo

The System_mongo class encapsulates the client interface of MongoDB.

    • Conn for connecting MONGO

    • Selectdb Selecting a Database

    • Selectcollection Selecting documents

    • FindOne get a piece of data

    • Find Get Data List

    • Select selection data can be sorted or interval

    • Insert Add Data

    • Update updates data

    • Close () Closes the connection

System_socket

System_socket class to encapsulate a network socket

System_memcache

The System_memcache class encapsulates the Memcached client interface

    • :: Set Cache

    • :: Get cache for Get

    • ::d elete Delete Cache

    • :: Flush Empty

    • :: Increment atomic count Plus

    • ::d ecrement Atomic Count minus

System_redis

System_redis class encapsulated Redis client driver

System_mysqlpdo

The System_mysqlpdo class encapsulates the Pdo_mysql operator 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 of the classic sorting algorithms

    • :: Insertion Insert Sort

    • :: Selection Select sort

    • :: Bubble Bubble sort

    • :: Merge Merging sort

Search_segment

Chinese participle of search_segment class

    • Init word breaker Initialization

    • Close closes

    • Query to get the original data list

    • Queryone Get single raw data

    • Cutquery splitting the original data

    • Cutstring splitting a string

Search_index

Search_index class for adding indexes

    • Setidprefix

    • Add to create INDEX data

    • Alert Update index data

    • Delete Deletes index data

Search_match

Search_match class for matching search results

    • Call Execution Match

Search_database

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

    • Get_doccount getting the total number of documents

    • Get_data get Single Document RAW data

    • Get_termlist get a single document word

    • Select Get Data list

Search_config

Search_config class can process search results based on configuration

    • Getapp Get App

    • Getappname Get app Name

    • Gettablename get the name of the tag

    • Formattitle Formatting titles

    • Formatdetail Formatting details

    • FormatUrl Formatting the Address bar

    • Formatimage Formatting pictures

Bin

Main

Server-side program, according to the name of the portal file to find Maincontroller, and then execute the Mainaction method; YAF CLI Mode entry file, in CLI mode can develop a powerful server-side program

./bin/main

Madserver

Madserver is the service side of the MADZMQ message queue implemented by PHP, which is subscribed as a subscriber from Madbroker, and the protocol is kvmsg.

./bin/madserver

hprose_swoole_tcp.php

RPC service, TCP protocol, support method, object method, asynchronous Call object method call:

Server-side code $server->add (New Testmodel (), "', ' test ');//Client call $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.