mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
Store url/dir query parameters in local var
This commit is contained in:
parent
70510ca506
commit
8a2b996021
@ -214,6 +214,8 @@ class StreamWrapper implements Vfs\StreamWrapperIface
|
|||||||
$this->opened_mode = $mode = str_replace('b','',$mode); // we are always binary, like every Linux system
|
$this->opened_mode = $mode = str_replace('b','',$mode); // we are always binary, like every Linux system
|
||||||
$this->opened_stream = null;
|
$this->opened_stream = null;
|
||||||
|
|
||||||
|
parse_str(parse_url($url, PHP_URL_QUERY), $this->dir_url_params);
|
||||||
|
|
||||||
if (!is_null($overwrite_new) || !($stat = static::url_stat($path,STREAM_URL_STAT_QUIET)) || $mode[0] == 'x') // file not found or file should NOT exist
|
if (!is_null($overwrite_new) || !($stat = static::url_stat($path,STREAM_URL_STAT_QUIET)) || $mode[0] == 'x') // file not found or file should NOT exist
|
||||||
{
|
{
|
||||||
if ($mode[0] == 'r' || // does $mode require the file to exist (r,r+)
|
if ($mode[0] == 'r' || // does $mode require the file to exist (r,r+)
|
||||||
|
@ -123,6 +123,13 @@ class StreamWrapper implements StreamWrapperIface
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $opened_dir_url;
|
private $opened_dir_url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Options for the opened directory
|
||||||
|
* (backup, etc.)
|
||||||
|
*/
|
||||||
|
protected $dir_url_params = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag if opened dir is writable, in which case we return un-readable entries too
|
* Flag if opened dir is writable, in which case we return un-readable entries too
|
||||||
*
|
*
|
||||||
@ -846,6 +853,7 @@ class StreamWrapper implements StreamWrapperIface
|
|||||||
function dir_opendir ( $path, $options )
|
function dir_opendir ( $path, $options )
|
||||||
{
|
{
|
||||||
$this->opened_dir = $this->extra_dirs = null;
|
$this->opened_dir = $this->extra_dirs = null;
|
||||||
|
$this->dir_url_params = array();
|
||||||
$this->extra_dir_ptr = 0;
|
$this->extra_dir_ptr = 0;
|
||||||
|
|
||||||
if (!($this->opened_dir_url = self::resolve_url_symlinks($path)))
|
if (!($this->opened_dir_url = self::resolve_url_symlinks($path)))
|
||||||
@ -857,7 +865,7 @@ class StreamWrapper implements StreamWrapperIface
|
|||||||
{
|
{
|
||||||
if (self::LOG_LEVEL > 0) error_log(__METHOD__."( $path,$options) opendir($this->opened_dir_url) failed!");
|
if (self::LOG_LEVEL > 0) error_log(__METHOD__."( $path,$options) opendir($this->opened_dir_url) failed!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->opened_dir_writable = Vfs::check_access($this->opened_dir_url,Vfs::WRITABLE);
|
$this->opened_dir_writable = Vfs::check_access($this->opened_dir_url,Vfs::WRITABLE);
|
||||||
// check our fstab if we need to add some of the mountpoints
|
// check our fstab if we need to add some of the mountpoints
|
||||||
$basepath = self::parse_url($path,PHP_URL_PATH);
|
$basepath = self::parse_url($path,PHP_URL_PATH);
|
||||||
@ -871,6 +879,8 @@ class StreamWrapper implements StreamWrapperIface
|
|||||||
$this->extra_dirs[] = basename($mounted);
|
$this->extra_dirs[] = basename($mounted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (self::LOG_LEVEL > 1) error_log(__METHOD__."( $path,$options): opendir($this->opened_dir_url)=$this->opened_dir, extra_dirs=".array2string($this->extra_dirs).', '.function_backtrace());
|
if (self::LOG_LEVEL > 1) error_log(__METHOD__."( $path,$options): opendir($this->opened_dir_url)=$this->opened_dir, extra_dirs=".array2string($this->extra_dirs).', '.function_backtrace());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -939,7 +949,16 @@ class StreamWrapper implements StreamWrapperIface
|
|||||||
// try reading the stat of the link
|
// try reading the stat of the link
|
||||||
if (($stat = self::url_stat($lpath, STREAM_URL_STAT_QUIET, false, true, $check_symlink_depth-1)))
|
if (($stat = self::url_stat($lpath, STREAM_URL_STAT_QUIET, false, true, $check_symlink_depth-1)))
|
||||||
{
|
{
|
||||||
if(isset($stat['url'])) $url = $stat['url'] .($u_query ? '?'.$u_query:''); // if stat returns an url use that, as there might be more links ...
|
$stat_query = parse_url($stat['url'], PHP_URL_QUERY);
|
||||||
|
if($u_query || $stat_query)
|
||||||
|
{
|
||||||
|
$stat_url = parse_url($stat['url']);
|
||||||
|
parse_str($stat_query,$stat_query);
|
||||||
|
parse_str($u_query, $u_query);
|
||||||
|
$stat_query = http_build_query(array_merge($stat_query, $u_query));
|
||||||
|
$stat['url'] = $stat_url['scheme'].'://'.$stat_url['host'].$stat_url['path'].'?'.$stat_query;
|
||||||
|
}
|
||||||
|
if(isset($stat['url'])) $url = $stat['url']; // if stat returns an url use that, as there might be more links ...
|
||||||
self::symlinkCache_add($path,$url);
|
self::symlinkCache_add($path,$url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user