Skip to content

minr/Karthus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Karthus

avatar

A simple Framework For Swoole

#使用说明

try {
    $service = new Service\Karthus('http://0.0.0.0:8000');   //设置服务的IP和端口
    $service
        ->setRouter(Config\Router::$Routers) //载入路由
        ->setLogFile(LOGGER_PATH . '/http.log') //设置日志路径
        ->setLogLevel(Service\Karthus::LEVER_DEBUG) //设置日志等级
        ->setProcessName(APP_NAME) //服务名
        ->setCompression(true) //启用HTTP压缩输出
        ->setPidFile() //设置PID文件
        ->setWorkerNum(16) //设置进程数
        ->responseJSON(true) //是否开启JSON输出,默认开启
        ->run();
}catch (Exception $exception){
    (new Tools\Logger())->error("{$exception->getMessage()}");
}

路由说明

//GET
        'get:/'     => array(
            'class'     => Index::class,
            'action'    => 'execute',
            'map_var'   => [],
        )

路由处于 Config/Router

其他请参考Apps/*.php 中

About

A simple Framework For Swoole

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages