teedmaker/tmphp-server-info

从实际服务器获取信息

v1.5.3 2019-09-11 14:20 UTC

This package is auto-updated.

Last update: 2024-09-12 01:31:58 UTC


README

TMPHP 服务器信息

该项目生成可以在 PHP 项目中使用的常量。

例如,您可以通过用户获取实际 URL,就像变魔术一样

$base = BASE;
...
echo "<a href=\"{$base}/new-url/test\">go to another page</a>";

或者,如果您需要包含所有内容的 URL,例如:http://site.com/teste[?user=lorem],则可以使用

$url = ACTUAL;
echo "<span>Real URL is: {$url}</a>";

当然,您可以在任何地方使用它

class AnotherClass
{
    /**
     * This will return this url containing the base url
     */
    public function getUrl(string $url) {
        return BASE . $url;
    }
}

准备好开始了吗?

您可以在 这里 了解如何安装!

您可以在 这里 了解如何使用!

发现了错误或可能性吗?

分叉它并向我们发送 pull request 😉