Coder Social home page Coder Social logo

biny's Issues

建议--结合下swoole

大概看了下框架的代码结构,加入swoole的话,改动不是很大。性能还会有一个量级的提升

不支持url中index.php访问?

必须实现重写,去掉index.php才能使用吗?
我试了如果不重写,哪怕只访问domain/index.php也出错;
即使做了重写,如果url中有index.php也会报错

添加namespace后,自动加载类失败

比如我在controller文件夹下面添加一个文件夹client,
然后在client文件夹下创建一个customerAction类customerAction.php 并继承baseAction,
文件最上面写namespace app\controller\client;
并且加上use app\controller\baseAction
例如

模板渲染问题

/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;

1

测试代码就不要出现在项目里了吧…

项目里似乎有很多测试的代码,总不能我们在用的时候,还需要去自己删除这部分代码吧。虽然这部分代码,有助于我们使用框架。但是,我觉得文档已经写的很详细啦🤣🤣🤣

我这里class TXDAO里面的function update的一个bug

您好,
近期在用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
希望您能给些建议或指导,谢谢啦。

TXService 思路不友好

TXService 工厂DAO 写法对 IDE 很不友好,开发会带来很多麻烦。不像静态语言可以定义类型,这种设计有点蹩脚

请问一下Service的用法是怎样的

从demo中的loginAction,操作数据库是直接调用DAO。而privilegeService感觉更像是横切的一个通用业务逻辑层。能否稍稍讲解一下Service的用法。

Biny里面能不能出个API授权机制

最近想开放一些接口让外部网站调用,但是不知道接口怎么写好些,比如身份认证,请求时间、次数限制,接口访问权限控制,不同身份的请求只能访问与之对应的接口,大神能不能在biny里面写一个让我参考下啊。。

额,我又来提问了,大神帮我看看这是怎么回事

`

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

请问大神,如何将路由的层数扩展到三层。

默认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()方法,并且同时支持两层路由的访问

composer 支持

感谢开源这么一个高性能的php框架.
看了一遍,发现不支持composer?这样的话很多php生态圈的库引用起来比较麻烦了.

Readme in English

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!

jquery error and scrollspy error

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

关于权限 privilege,错误能不显示吗?

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}

这个错误信息能不显示吗?

关于privilegeService的一些使用疑问

我打算使用privilegeService做一些类似前置拦截器的功能(验证每个ajax请求的token),自定义的验证方法(// privilegeService.php)返回false时,我注意到只是call_user_func_array,那么callback做什么好像都影响不到整个流程,没有else甚至会直接throw 6001。就我的使用流程来看貌似是这样的

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.