Git Product home page Git Product logo

asf's Introduction

Asf - API Services Framework

Build Status

Simple, High performance PHP framework written in C.

Introduction

API Services Framework (or simply Asf). It's has many micro-innovation and is a new generation of lightweight MVC framework.

Features

  • The class provided by the framework, loaded when the PHP process starts, and resident in memory.
  • Errno = 999, PHP fatal error interception.
  • Strong early warning mechanism (DB, Cache, Script, PHP Error).
  • Support for Logger Buffer Cache
  • Support for GPC methods, making it easier to use PHP global variables ($_GET, $_POST, $_COOKIE)
  • Support for configuration file resident memory
  • Support for faster, easier-to-operate cookie management

Install

Requirements

  • PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4
  • GCC 4.4.0+ (Recommended GCC 4.8+)

DownLoad

git clone https://github.com/yulonghu/asf.git

Compile for Linux/Unix/Mac

Provide two installation methods. Select No.1, Use the following methods to install the extension:

cd asf/travis
sudo ./install -i /path/to/phpize -c /path/to/php-config

Select No.2, PHP extension standard installation:

cd asf/asf
/path/to/phpize
./configure --with-php-config=/path/to/php-config
make && make install

Add the extension to your php.ini

extension=asf.so

Restart the web server

Documentation

http://www.box3.cn/phpasf/index.html

Get Started

Use tools to create a new project

/php-bin-path/php asf-src/tools/asf_project.php /to-path/project_name

Layout

+ public
  | - index.php
+ config
  | - config.php
+ library
+ modules
    | - Bootstrap.php
    | - Constants.php
  + api
    |+ services
	   |- Index.php  // Default service
    |+ logics
    |+ daos

config/config.php

<?php
$configs = array(
    'asf' => array(
        'root_path' => APP_PATH . '/modules',
    )
);

return $configs;

public/index.php

<?php
define('APP_PATH', dirname(__DIR__));

$app = new Asf_Application(APP_PATH . '/config/config.php');
$app->run();

Default service

<?php
class IndexService
{
    public function indexAction()
    {
        return 'Hello World';
    }
}

Run in Nginx/Apache/Lighttpd

http://www.your-domain.com

Output results

{
    "errno": 0,
    "data": "Hello World"
}

License

Asf is open source software under the PHP License v3.01

asf's People

Contributors

yulonghu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.