Glob pattern does not match anything

前端 未结 1 1490
广开言路
广开言路 2021-01-13 00:09

NOTE: The pattern in question has been removed from the PHP documentation since this thread was created.

According to the PHP documentation, the pat

1条回答
  •  野的像风
    2021-01-13 00:51

    The documentation is incomplete or even incorrect. As of Nov 2019, there is no code to explicitly support recursive glob syntax in PHP and the underlying operating system libraries are unlikely to support it either.

    1. There is no recursive glob syntax in IEEE 1003.1

    2. PHP UNIX implementation delegates to GLOB(3) from a standard C library. On Linux this will most likely be glibc which has no support for recursive syntax.

    3. PHP Windows implementation has no support for directory recursion

    4. None of the glob tests in PHP test suite include a test that covers a triple dot (...) syntax.

    5. According to the commit message of the change that introduced glob pattern syntax to PHP documentation, the list of special characters was based on the ones supported by djgpp libc library. The djgpp manpage states that the triple dot syntax is a nod to an old VMS feature.

      ... Matches all the subdirectories, recursively (VMS aficionados, rejoice!).

    All of this is strong evidence that the recursive syntax listed in the documentation will not work unless PHP is running on a platform that has support for it, e.g. DJGPP on DOS or old Windows.

    0 讨论(0)
提交回复
热议问题