On Mar 31, 2017 8:19 AM, "S.A.N" <ua.san.a...@gmail.com> wrote:

> Another option would be to create a function that converts all slashes in
a
> given input string to whatever the directory seperator should be on that
> platform.  This way, devs wouldn't have to deal with bulky aliases like
> DIRECTORY_SEPERATOR cluttering up their code.
>
> For example:
>
> <?php
>
> print convert_seperators( '/some\directory/' );
>
> ?>
>
> The above would output "/some/directory" on Linux and "\some\directory" on
> Windows.

+1
Can be used, for convert NAMESPACE to filepath in autoload )

<?php

function __autoload($path)
{
    include convert_seperators($path);
}


On Windows, it is what realpath does.



--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to