ThinkPHP5.0 源码分析

342 阅读1分钟
        if ($resultSet = $query->select($data)) {
            foreach ($resultSet as $data) {
                $result = $data->delete($force);
                $count += $result;
            }
        }

有大量的后面用原变量名直接覆盖前一变量的。

此错排名第6


Line library\think\Route.php


990 Undefined property: $auto

993 Undefined property: $miss

993 Undefined property: $miss


属性未定义,且无__get和__set


Line library\think\console\output\Ask.php


201 Undefined property: $tmpExe


属性未定义,且无__get和__set


Line library\think\model\relation\OneToOne.php


95 Access to an undefined property

think\model\relation\OneToOne::$option.

属性未定义,且无__get和__set

此错排名第5

think\config\driver
$content = simplexml_load_file($config);

少传参数会引发PHP本身的BUG,估计未看文档,记事本开发。牛人好像都是这样的。

此错排名第4

    think\cache\Driver\File
    think\console\command\optimize
            @mkdir(RUNTIME_PATH, 0755, true);

direct call the origianal php function without try catch block!

做了十年的框架,没有文件系统组件,这行是有@,还有大量没有@,完全祼调mkdir

你的可是框架源码,我就是加了文件系统组件也不起作用呀!!!!

此错排名第3


    think\console\output\Formatter
            if ($open = '/' != $text[1]) {

这样的if,不清楚作者倒底想要什么,玩代码精简也不能这么玩吧?

此错排名第2


Line library\think\console\Input.php


211 Call to sprintf contains 1 placeholder, 2 values given.

 throw new \RuntimeException(sprintf('The "--%s" option does not accept a value.', $name, $value));

为什么调试时,只看到变量名,看不到数值,高手的代码

我想问作者:你测试了吗????????

此错排名第1