You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, you only need it if you deal with paths provided by the system, or if you want to mix system-provided and user-provided paths, and want to avoid a mixture of slash and backslash.
So far so good.
The little "problem" is, that ClassLoader_Pluggable::addNamespacePlugin() actually takes a "$logicalBasePath" as its first argument, and this must have the correct separator. The "RegistrationHub" does the conversion from namespace to logical path. But if you register your stuff directly on the class loader, then you need to take care to replace every slash with directory separator. Baaad.
The text was updated successfully, but these errors were encountered:
Yes, the constant is only relevant when dealing with paths obtained from the system (e.g. you're parsing getenv("PATH")). No, it's not useful for avoiding a mixture of delimiters. You may parse a path with either delimiter (e.g. reading a path from a config file) and output the path using only / (i.e. normalised to the generic delimiter). Accessing a file using / delimiters always works, Windows actually supports mixed delimiters within a single path specification.
PHP isn't supported on "classic" MacOS, the INSTALL used to explicitly state this fact. I reckon it's going to be difficult setting up a recent version of PHP on ancient OS X versions as well.
The second commit is fine in itself, but you can safely avoid the extra code and strcat operation by using / whenever a path is constructed.
Other class loaders (Symfony, Composer) work a lot with the DIRECTORY_SEPARATOR constant.
As I can read somewhere, this is meant for Windows, but simply using slash would work just fine.
Although, here it is pointed out this is also for "Mac OS Classic":
http://stackoverflow.com/questions/625332/is-using-the-directory-separator-constant-neccessary
On Windows, you only need it if you deal with paths provided by the system, or if you want to mix system-provided and user-provided paths, and want to avoid a mixture of slash and backslash.
So far so good.
The little "problem" is, that ClassLoader_Pluggable::addNamespacePlugin() actually takes a "$logicalBasePath" as its first argument, and this must have the correct separator. The "RegistrationHub" does the conversion from namespace to logical path. But if you register your stuff directly on the class loader, then you need to take care to replace every slash with directory separator. Baaad.
The text was updated successfully, but these errors were encountered: