tencent / biny Goto Github PK
View Code? Open in Web Editor NEWBiny is a tiny, high-performance PHP framework for web applications
License: BSD 3-Clause "New" or "Revised" License
Biny is a tiny, high-performance PHP framework for web applications
License: BSD 3-Clause "New" or "Revised" License
比如我在controller文件夹下面添加一个文件夹client,
然后在client文件夹下创建一个customerAction类customerAction.php 并继承baseAction,
文件最上面写namespace app\controller\client;
并且加上use app\controller\baseAction
例如
如题
麻烦简单说框架内文件上传的操作流程
有和各大主流PHP框架的性能对比图吗
我想访问../../../web/static/css/main.css
结果访问不了
程序报错 Fatal error: Autoload file[app\controller\webAction] is fails in
大神,这个怎么解决啊
前面的issue也有人提到过,vendor是composer的默认包安装位置。Biny框架相对来说比较轻量级,有时候开发我们需要用到一些composer包,在vendor目录下面有Tiny的一些框架源代码总感觉不太习惯。
最近想开放一些接口让外部网站调用,但是不知道接口怎么写好些,比如身份认证,请求时间、次数限制,接口访问权限控制,不同身份的请求只能访问与之对应的接口,大神能不能在biny里面写一个让我参考下啊。。
或者录制一两节视频,让我们这些小白期待已久的也能入手练练
本来就想catch里打日志,这可咋整
谢了哦
默认biny的的路由只有两层
当访问https://biny.com/article/add时
实际访问的是/app/controller/article/addAction.php文件下的action_add()方法
我想在路由上面多加一层以区分前台后台,但路由貌似不支持:
当访问 https://biny.com/admin/article/add时会提示找不到action_article()方法
能不能有什么办法可以访问到/app/controller/admin/article/addAction.php这个文件下的action_add()方法,并且同时支持两层路由的访问
默认SQL文件在框架内吗?修改 config之后,提示 sql 报错了,想预览下效果
Hello,
Your framework appears in Github trending repositories and seems quite interesting. Could you please provide a Readme file in English or another European language?
Thanks!
大概看了下框架的代码结构,加入swoole的话,改动不是很大。性能还会有一个量级的提升
//判断是否维护中
if (isMaintenance){
return $this->display('Main/maintenance');
}
如题,请问能否告知多库join是在哪个文件里实现的?
您好,
近期在用Biny做一个项目,
不知是php.ini的原因还是什么原因,在类TXDAO里面的函数update中的如下语句
$params = func_get_args();
在$params[1]中没有传进来TXCond实例,导致最终执行的sql没有加上where条件。
例如我在baseModel类中执行的是$this->DAO->updateByPk(1, ['del'=>1]);
期望执行update client set del=1 where id=1
结果执行update client set del=1
调查发现TXCond中的如下函数已经传了$this了,不知为什么调用func_get_args()取参数时并没有接收到这个object参数。我试了一下,如果是$args[] = 123;啥的是可以传过去的。
public function __call($method, $args)
{
if (in_array($method, $this->methods) || in_array($method, $this->calcs)){
$args = $args ? $args : [''];
$args[] = $this;
return call_user_func_array([$this->DAO, $method], $args);
} else {
throw new TXException(3009, [$method, CLASS]);
}
}
我的执行环境是
nginx/1.12.1
PHP/7.1.9
希望您能给些建议或指导,谢谢啦。
请问TXDatebase::start()
开启事务后,怎么捕获事务中的异常呢?然后进行针对异常的逻辑处理
必须实现重写,去掉index.php才能使用吗?
我试了如果不重写,哪怕只访问domain/index.php也出错;
即使做了重写,如果url中有index.php也会报错
Hi,
the project tagline:
"Biny is a tiny, high-performace PHP framework for web applications "
should be:
"Biny is a tiny, high-performance PHP framework for web applications "?
`
Fatal error: System Error [PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_pdo_mysql.dll' - /usr/lib/php/20151012/php_pdo_mysql.dll: cannot open shared object file: No such file or directory] in /home/kang/product/kwms/lib/TXApp.php:153 -- | Stack trace: | #0 [internal function]: TXApp::handleFatalError() | #1 {main} ` 有时候刷新一下页面,在页面的最底部会现这个,然后在刷新一下就又没有了,请问这是怎么回事啊,是不是我的环境配置有问题。 Apache/2.4.18 (Ubuntu) php 7.0.22 mysql 5.7.20-0ubuntu0.16.04.1
因为发现update方法在执行update...where id>0这种语句的时候没法得知是否更新完成,不知增加后是否会有影响
我看到项目里有大片的array,又有一部分[],总感觉怪怪的
<? include TXApp::$view_root . "/base/common.tpl.php" ?>
我打算使用privilegeService做一些类似前置拦截器的功能(验证每个ajax请求的token),自定义的验证方法(// privilegeService.php)返回false时,我注意到只是call_user_func_array,那么callback做什么好像都影响不到整个流程,没有else甚至会直接throw 6001。就我的使用流程来看貌似是这样的
这是sf1时代的特色,可以去掉了
感谢开源这么一个高性能的php框架.
看了一遍,发现不支持composer?这样的话很多php生态圈的库引用起来比较麻烦了.
TXService 工厂DAO 写法对 IDE 很不友好,开发会带来很多麻烦。不像静态语言可以定义类型,这种设计有点蹩脚
app/controller/base/baseAction.php
webRoot和CDN_ROOT的命名方式统一一下比较好😊
项目里似乎有很多测试的代码,总不能我们在用的时候,还需要去自己删除这部分代码吧。虽然这部分代码,有助于我们使用框架。但是,我觉得文档已经写的很详细啦🤣🤣🤣
/lib/business/TXResponse.php中的这段代码读取缓冲区内容不稳定,导致前端页面渲染失败:
ob_start();
//include template
$lang = TXLanguage::getLanguage();
$file = sprintf('%s/template/%s%s.tpl.php', TXApp::$app_root, $this->view, $lang ?'.'.$lang : "");
if (!is_readable($file)){
$file = sprintf('%s/template/%s.tpl.php', TXApp::$app_root, $this->view);
}
if (!is_readable($file)){
throw new TXException(2005, $this->view);
}
include $file;
TXLogger::showLogs();
$content = ob_get_clean();
return $content;
public function my_required($action, $key)
{
if($key){
return$this->correct();
}else{
return $this->error('key not exists');
}
}
when i download the src code from github and try to run it ,it show error info that jquery is not defined and scrollspy id not defined.in demo.tpl.php
类名是 person
,文件名却是 Person
。导致demo就出错了。后来把文件名改成小写就好了。
NO editing virtual hosts in Apache or Nginx
NO adding php_value flags to .htaccess files
EASY portability and sharing of required ENV values
COMPATIBLE with PHP's built-in web server and CLI runner
From https://github.com/vlucas/phpdotenv#why-env
Fatal error: privilege [login_required] is not access [非法请求] in D:\htdocs\chatWeb\lib\business\TXAction.php:123
Stack trace:
#0 D:\htdocs\chatWeb\lib\business\TXAction.php(79): biny\lib\TXAction->valid_privilege()
#1 D:\htdocs\chatWeb\lib\business\TXFactory.php(68): biny\lib\TXAction->__construct()
#2 D:\htdocs\chatWeb\lib\business\TXFactory.php(45): biny\lib\TXFactory::loadClass('adminAction', 'adminAction')
#3 D:\htdocs\chatWeb\lib\business\TXRequest.php(232): biny\lib\TXFactory::create('adminAction')
#4 D:\htdocs\chatWeb\lib\business\TXController.php(54): biny\lib\TXRequest->getModule(true)
#5 D:\htdocs\chatWeb\lib\business\TXController.php(42): biny\lib\TXController->call(Object(biny\lib\TXRequest))
#6 D:\htdocs\chatWeb\lib\business\TXController.php(105): biny\lib\TXController->execute()
#7 D:\htdocs\chatWeb\lib\TXApp.php(177): biny\lib\TXController->dispatcher()
#8 D:\htdocs\chatWeb\web\index.php(21): TXApp::run()
#9 {main}
这个错误信息能不显示吗?
//config/config.php 中写道
'routeRule' => array(
'demo' => 'demo',
'demo.html' => 'demo',
'/demo/'=>'demo',
),
//访问 http:///demo/ or http:///demo.html 都不对,显示404
求正解!
以后会有具体的演示吗?
action开启了RESTful Api在初始化时this->param是通过file_get_contents('php://input')赋值的,但是我多次调试发现file_get_contents('php://input')是没有内容,不知道是什么情况
如果按照新版的配置'paramsType'] => 'one'
,该怎样用display在视图中绑定参数?
从demo中的loginAction,操作数据库是直接调用DAO。而privilegeService感觉更像是横切的一个通用业务逻辑层。能否稍稍讲解一下Service的用法。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.