V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
bluebat8009
V2EX  ›  PHP

求教,在 PHP7 中做扩展开发,我想知道执行 PHP 脚本的路径,如何获取呢

  •  
  •   bluebat8009 · Oct 23, 2019 · 4571 views
    This topic created in 2383 days ago, the information mentioned may be changed or developed.
    6 replies    2019-11-07 17:52:25 +08:00
    bluebat8009
        1
    bluebat8009  
    OP
       Oct 23, 2019
    实际上,就是在 PHP 的扩展中如何实现 PHP 的__FILE__常量了
    UpThemountain
        2
    UpThemountain  
       Oct 23, 2019
    能不能变相传入路径?我也准备做扩展开发方面的研究学习 方便加 V 交流学习?
    wx:chen_1992227
    bluebat8009
        3
    bluebat8009  
    OP
       Oct 23, 2019
    @UpThemountain 系统应该有个默认的系统变量了,但是我目前不知道,就是我想再某些路径里面,这个扩展的某些函数不启作用
    jjshare
        4
    jjshare  
       Oct 23, 2019
    什么情况下需要用扩展解决
    agdhole
        5
    agdhole  
       Oct 23, 2019
    Windows 可以用
    Get-Command 'php.exe' -erroraction silentlycontinue -Syntax
    szopen
        6
    szopen  
       Nov 7, 2019
    当前文件路径在 execute_data 结构中可以获取到,execute_data 就是 PHP_FUNCTION 宏的第一个参数
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2632 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 03:36 · PVG 11:36 · LAX 20:36 · JFK 23:36
    ♥ Do have faith in what you're doing.