mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-11 08:10:58 +00:00
SSH2: better accomodate Phar's
This commit is contained in:
parent
1f99fc3c3c
commit
70b9a69c46
@ -3624,7 +3624,15 @@ class Net_SSH2
|
|||||||
*/
|
*/
|
||||||
function _is_includable($suffix)
|
function _is_includable($suffix)
|
||||||
{
|
{
|
||||||
foreach (explode(PATH_SEPARATOR, get_include_path()) as $prefix) {
|
// stream_resolve_include_path was introduced in PHP 5.3.2
|
||||||
|
if (function_exists('stream_resolve_include_path')) {
|
||||||
|
return stream_resolve_include_path($suffix) !== false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$paths = PATH_SEPARATOR == ':' ?
|
||||||
|
preg_split('#(?<!phar):#', get_include_path()) :
|
||||||
|
explode(PATH_SEPARATOR, get_include_path());
|
||||||
|
foreach ($paths as $prefix) {
|
||||||
$ds = substr($prefix, -1) == DIRECTORY_SEPARATOR ? '' : DIRECTORY_SEPARATOR;
|
$ds = substr($prefix, -1) == DIRECTORY_SEPARATOR ? '' : DIRECTORY_SEPARATOR;
|
||||||
$file = $prefix . $ds . $suffix;
|
$file = $prefix . $ds . $suffix;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user