valet有适合TP5的驱动吗

发布时间:2021-10-21 17:33:25 作者:iii
来源:亿速云 阅读:156

这篇文章主要讲解了“valet有适合TP5的驱动吗”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“valet有适合TP5的驱动吗”吧!

valet 有没有适合thinkphp5的驱动?

觉得valet的思路很好所以采用了这个来做环境。

公司里面用thinkphp的人比较多。所以要使用thinkphp。(而且我是弄前端的,后端用啥也不会特别在意)

https://github.com/curder/blog/blob/master/tools/valet_support_thinkphp.md

这是thinkphp3-valet的。

↓↓↓↓↓↓↓

自己简单写了一个现在试的可以用。

<?php
class ThinkPHP5ValetDriver extends ValetDriver
{
    /**
     * Determine if the driver serves the request.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return bool
     */
    public function serves($sitePath, $siteName, $uri)
    {
        return true;
    }
    /**
     * Determine if the incoming request is for a static file.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return string|false
     */
    public function isStaticFile($sitePath, $siteName, $uri)
    {
        if (file_exists($staticFilePath = $sitePath.$uri)) {
            return $staticFilePath;
        }
        return false;
    }
    /**
     * Get the fully resolved path to the application's front controller.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return string
     */
    public function frontControllerPath($sitePath, $siteName, $uri)
    {
        $_SERVER['SCRIPT_FILENAME'] = 'index.php';
        $_SERVER['SCRIPT_NAME'] = '';
        $_SERVER['PHP_SELF'] = '/index.php';
        $_SERVER['PATH_INFO'] = $uri;
        return $sitePath.'/index.php';
    }
}

感谢各位的阅读,以上就是“valet有适合TP5的驱动吗”的内容了,经过本文的学习后,相信大家对valet有适合TP5的驱动吗这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

推荐阅读:
  1. 用Python语言入门适合吗 伟大的编程有什么特征
  2. php适合大型网站的开发吗

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

valet

上一篇:怎么让APP永不崩溃

下一篇:linux中Sudo命令使用技巧有哪些

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》