Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

去除旧版的静态获取TP版本,以免混淆 #3082

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

ken678
Copy link
Contributor

@ken678 ken678 commented Oct 21, 2024

首选这个版本变量也不更新了,方法也改成composer获取TP版本了
所以去除旧版的静态获取TP版本,有些人会从app.php里面看版本,以免混淆一直以为下载的旧版本8.0.0

去除旧版的静态获取TP版本,以免混淆
@augushong
Copy link

不应该去掉,应该保持和git的同步,我的框架正在用这个常量。

@hulang
Copy link

hulang commented Oct 21, 2024

@augushong 大佬,没有必要使用那样获取吧。我是在base控制器使用:
$this->app->version()方法获取。。。获取到是:8.0.4。。。
thinkphp框架里面自带app->version()

    /**
     * 获取框架版本
     * @access public
     * @return string
     */
    public function version(): string
    {
        return ltrim(InstalledVersions::getPrettyVersion('topthink/framework'), 'v');
    }

@big-dream
Copy link
Contributor

可以考虑先标记为弃用,下个大版本删除

@augushong
Copy link

恩,是我用错了,该删就删吧。没注意到他们不一样。

@hulang
Copy link

hulang commented Oct 21, 2024

恩,是我用错了,该删就删吧。没注意到他们不一样。

嗯。是的额。。因为ltrim(InstalledVersions::getPrettyVersion('topthink/framework'), 'v')获取的是composer安装的版本。。
如我把:topthink/framework换成topthink/think-orm结果是:3.0.28

@liu21st liu21st merged commit ef556c1 into top-think:8.0 Oct 21, 2024
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants