ohworkit/sirius
Composer 安装命令:
composer require ohworkit/sirius
包简介
sirius php framework
README 文档
README
Sirius is a miniature of web application framework. Usage as laravel, but is small, fast framework.Only provide routing, blade templates, database operations, Memcache and Redis operation function
Install
To install with composer:
composer require ohworkit/sirius
Usage
bootstrap.php
// BASE_PATH
define('BASE_PATH', __DIR__);
// Autoload
require BASE_PATH.'/vendor/autoload.php';
$app = new Sirius\Sirius();
$app->run();
More Sirius Demo
Framework require
Route
use FastRoute - Fast request router for PHP
View Engine
Use the simple and yet powerful Laravel Blade templating engine as a standalone component
You can use all blade features as described in the Laravel 5 documentation: http://laravel.com/docs/templates#blade-templating
Illuminate Database
The Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style ORM, and schema builder. It currently supports MySQL, Postgres, SQL Server, and SQLite. It also serves as the database layer of the Laravel PHP framework.
For further documentation on using the various database facilities this library provides, consult the Laravel framework documentation.
Memcached
config.
"memcache" => array(
"default" => array(
"servers" => [
array("127.0.0.1",11211,5),
//array(host,port,weight),
],
"persistent_id" => null,
"options" => array(
Memcached::OPT_LIBKETAMA_COMPATIBLE => true,
Memcached::OPT_PREFIX_KEY => "sirius:"
),
),
),
use.
//by default
Cache::set($key,$value,$expire);
Cache::get($key);
//has other instance
Cache::connection("other config name")->set($key,$value,$expire);
Cache::connection("other config name")->get($key);
Redis
Flexible and feature-complete PHP client library for Redis https://github.com/nrk/predis/wiki
config. more
"redis" => array(
"default" => array(
"parameters" => [
'tcp://127.0.0.1?alias=master',
//'tcp://10.0.0.2?alias=slave-01'
],
"options" => [
//'replication' => true,
"prefix" => "sirius:",
],
),
),
use.
//by default
SiriusRedis::set($key,$value,$expire);
SiriusRedis::get($key);
//has other instance
SiriusRedis::connection("other config name")->set($key,$value,$expire);
SiriusRedis::connection("other config name")->get($key);
Webbench
same web server
Sirius
siege -c 500 -t 20s http://sirius.ohworkit.com/
Transactions: 8997 hits
Availability: 99.91 %
Elapsed time: 19.16 secs
Data transferred: 1.13 MB
Response time: 0.40 secs
Transaction rate: 469.57 trans/sec
Throughput: 0.06 MB/sec
Concurrency: 189.91
Successful transactions: 8997
Failed transactions: 8
Longest transaction: 15.87
Shortest transaction: 0.15
vs Laravel 5
siege -c 500 -t 20s http://laravel.ohworkit.com/
disable session
Transactions: 465 hits
Availability: 26.74 %
Elapsed time: 19.99 secs
Data transferred: 0.23 MB
Response time: 2.66 secs
Transaction rate: 23.26 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 61.81
Successful transactions: 465
Failed transactions: 1274
Longest transaction: 15.33
Shortest transaction: 0.17
vs Phalcon 2
siege -c 500 -t 20s http://phalcon.ohworkit.com/
Transactions: 11034 hits
Availability: 100.00 %
Elapsed time: 19.67 secs
Data transferred: 2.96 MB
Response time: 0.28 secs
Transaction rate: 560.96 trans/sec
Throughput: 0.15 MB/sec
Concurrency: 155.34
Successful transactions: 11034
Failed transactions: 0
Longest transaction: 11.33
Shortest transaction: 0.13
License
The Sirius framework is open-sourced software licensed under the MIT license
ohworkit/sirius 适用场景与选型建议
ohworkit/sirius 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 35 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ohworkit/sirius 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ohworkit/sirius 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-14