donpvtzuux37724 2017-12-21 09:09
浏览 104
已采纳

在魔术常量__FILE__的描述中,“符号链接已解决”是什么意思?

I'm using PHP 7.2.0

Below is a description of magic constant __FILE__ :

The full path and filename of the file with symlinks resolved. If used inside an include, the name of the included file is returned.

I didn't understand meaning of the clause "filename of the file with symlinks resolved"

Someone please make me understand the meaning of this clause with demonstrative suitable example of usage of magic constant __FILE__ accompanied by appropriate explanation.

  • 写回答

1条回答 默认 最新

  • dongre8505 2017-12-21 09:14
    关注

    Symlinks (symbolic links) are "shortcuts" you can create in the filesystem to point one directory entry at any arbitrary other directory entry. On a *NIX shell, something like:

    $ ln -s /foo/bar.php /baz
    

    This establishes /baz as a symlink to /foo/bar.php. Whichever file you use now, they're effectively both the same.

    Resolving symlinks means to look at a given path, recognise symlinks within it and replace them by the actual file path they point to. So, regardless of whether you do

    $ php /baz
    

    or

    $ php /foo/bar.php
    

    the __FILE__ constant will be resolved to the actual file path /foo/bar.php.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向