mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:38 +01:00
Removed array () as default value in function prototypes per loic's patch #464195
This commit is contained in:
parent
7fc7a192c5
commit
813c3ab5cd
@ -283,10 +283,15 @@
|
||||
@result Boolean True/False
|
||||
*/
|
||||
|
||||
function add_journal ($string, $relatives = array (RELATIVE_CURRENT), $operation, $state_one = False, $state_two = False, $incversion = True)
|
||||
function add_journal ($string, $relatives = '', $operation, $state_one = False, $state_two = False, $incversion = True)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$account_id = $phpgw_info["user"]["account_id"];
|
||||
|
||||
$p = $this->path_parts ($string, array ($relatives[0]));
|
||||
@ -529,10 +534,15 @@
|
||||
@result Boolean True/False
|
||||
*/
|
||||
|
||||
function flush_journal ($string, $relatives = array (RELATIVE_CURRENT), $deleteall = False, $deletedonly = False)
|
||||
function flush_journal ($string, $relatives = '', $deleteall = False, $deletedonly = False)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($string, array ($relatives[0]));
|
||||
|
||||
$sql = "DELETE FROM phpgw_vfs WHERE directory='$p->fake_leading_dirs_clean' AND name='$p->fake_name_clean'";
|
||||
@ -572,10 +582,15 @@
|
||||
@result Array of arrays of journal entries
|
||||
*/
|
||||
|
||||
function get_journal ($string, $relatives = array (RELATIVE_CURRENT), $type = False)
|
||||
function get_journal ($string, $relatives = '', $type = False)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($string, array ($relatives[0]));
|
||||
|
||||
if (!$this->acl_check ($p->fake_full_path, array ($p->mask)))
|
||||
@ -644,9 +659,15 @@
|
||||
outside is boolean, True if $relatives contains VFS_REAL
|
||||
*/
|
||||
|
||||
function path_parts ($string, $relatives = array (RELATIVE_CURRENT), $object = True, $nolinks = False)
|
||||
function path_parts ($string, $relatives = '', $object = True, $nolinks = False)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$sep = SEP;
|
||||
|
||||
$rarray["mask"] = RELATIVE_NONE;
|
||||
@ -807,7 +828,7 @@
|
||||
@result $basedir Full fake or real path
|
||||
*/
|
||||
|
||||
function getabsolutepath ($target = False, $relatives = array (RELATIVE_CURRENT), $fake = True)
|
||||
function getabsolutepath ($target = False, $relatives = '', $fake = True)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
@ -912,10 +933,15 @@
|
||||
@result Boolean. True if access is ok, False otherwise
|
||||
*/
|
||||
|
||||
function acl_check ($file, $relatives = array (RELATIVE_CURRENT), $operation = PHPGW_ACL_READ, $must_exist = False)
|
||||
function acl_check ($file, $relatives = '', $operation = PHPGW_ACL_READ, $must_exist = False)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
/* Accommodate special situations */
|
||||
if ($this->override_acl)
|
||||
{
|
||||
@ -1034,10 +1060,15 @@
|
||||
@param $relatives Relativity array
|
||||
*/
|
||||
|
||||
function cd ($target = "/", $relative = True, $relatives = array (RELATIVE_CURRENT))
|
||||
function cd ($target = "/", $relative = True, $relatives = '')
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
if ($relatives[0] & VFS_REAL)
|
||||
{
|
||||
$sep = SEP;
|
||||
@ -1105,11 +1136,16 @@
|
||||
@result $contents Contents of $file, or False if file cannot be read
|
||||
*/
|
||||
|
||||
function read ($file, $relatives = array (RELATIVE_CURRENT))
|
||||
function read ($file, $relatives = '')
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($file, array ($relatives[0]));
|
||||
|
||||
if (!$this->acl_check ($p->fake_full_path, array ($p->mask), PHPGW_ACL_READ))
|
||||
@ -1139,11 +1175,16 @@
|
||||
@result Boolean True/False
|
||||
*/
|
||||
|
||||
function write ($file, $relatives = array (RELATIVE_CURRENT), $contents)
|
||||
function write ($file, $relatives = '', $contents)
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($file, array ($relatives[0]));
|
||||
|
||||
if ($this->file_exists ($p->fake_full_path, array ($p->mask)))
|
||||
@ -1197,10 +1238,15 @@
|
||||
@result Boolean True/False
|
||||
*/
|
||||
|
||||
function touch ($file, $relatives = array (RELATIVE_CURRENT))
|
||||
function touch ($file, $relatives = '')
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$account_id = $phpgw_info["user"]["account_id"];
|
||||
$currentapp = $phpgw_info["flags"]["currentapp"];
|
||||
|
||||
@ -1263,11 +1309,16 @@
|
||||
@result boolean True/False
|
||||
*/
|
||||
|
||||
function cp ($from, $to, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
|
||||
function cp ($from, $to, $relatives = '')
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$account_id = $phpgw_info["user"]["account_id"];
|
||||
|
||||
$f = $this->path_parts ($from, array ($relatives[0]));
|
||||
@ -1367,10 +1418,10 @@
|
||||
return True;
|
||||
}
|
||||
|
||||
function copy ($from, $to, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
|
||||
function copy ($from, $to, $relatives = '')
|
||||
{
|
||||
umask (000);
|
||||
return $this->cp ($from, $to);
|
||||
return $this->cp ($from, $to, $relatives);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -1382,11 +1433,16 @@
|
||||
@result boolean True/False
|
||||
*/
|
||||
|
||||
function mv ($from, $to, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
|
||||
function mv ($from, $to, $relatives = '')
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$account_id = $phpgw_info["user"]["account_id"];
|
||||
|
||||
$f = $this->path_parts ($from, array ($relatives[0]));
|
||||
@ -1498,7 +1554,7 @@
|
||||
@abstract shortcut to mv
|
||||
*/
|
||||
|
||||
function move ($from, $to, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
|
||||
function move ($from, $to, $relatives = '')
|
||||
{
|
||||
umask (000);
|
||||
return $this->mv ($from, $to, $relatives);
|
||||
@ -1512,11 +1568,16 @@
|
||||
@result boolean True/False
|
||||
*/
|
||||
|
||||
function rm ($string, $relatives = array (RELATIVE_CURRENT))
|
||||
function rm ($string, $relatives = '')
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($string, array ($relatives[0]));
|
||||
|
||||
if (!$this->acl_check ($p->fake_full_path, array ($p->mask), PHPGW_ACL_DELETE))
|
||||
@ -1608,7 +1669,7 @@
|
||||
@abstract shortcut to rm
|
||||
*/
|
||||
|
||||
function delete ($string, $relatives = array (RELATIVE_CURRENT))
|
||||
function delete ($string, $relatives = '')
|
||||
{
|
||||
return $this->rm ($string, $relatives);
|
||||
}
|
||||
@ -1621,11 +1682,16 @@
|
||||
@result boolean True on success
|
||||
*/
|
||||
|
||||
function mkdir ($dir, $relatives = array (RELATIVE_CURRENT))
|
||||
function mkdir ($dir, $relatives = '')
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$account_id = $phpgw_info["user"]["account_id"];
|
||||
$currentapp = $phpgw_info["flags"]["currentapp"];
|
||||
|
||||
@ -1678,11 +1744,16 @@
|
||||
@result Boolean True/False
|
||||
*/
|
||||
|
||||
function make_link ($vdir, $rdir, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
|
||||
function make_link ($vdir, $rdir, $relatives = '')
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$account_id = $phpgw_info["user"]["account_id"];
|
||||
$currentapp = $phpgw_info["flags"]["currentapp"];
|
||||
|
||||
@ -1736,11 +1807,21 @@
|
||||
version
|
||||
*/
|
||||
|
||||
function set_attributes ($file, $relatives = array (RELATIVE_CURRENT), $attributes = array ())
|
||||
function set_attributes ($file, $relatives = '', $attributes = '')
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
if (!is_array ($attributes))
|
||||
{
|
||||
$attributes = array ();
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($file, array ($relatives[0]));
|
||||
|
||||
/*
|
||||
@ -1826,10 +1907,15 @@
|
||||
@result Boolean True/False
|
||||
*/
|
||||
|
||||
function correct_attributes ($string, $relatives = array (RELATIVE_CURRENT))
|
||||
function correct_attributes ($string, $relatives = '')
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($string, array ($relatives[0]));
|
||||
|
||||
if ($p->fake_leading_dirs != $this->fakebase && $p->fake_leading_dirs != "/")
|
||||
@ -1861,10 +1947,15 @@
|
||||
@result MIME type, "Directory", or nothing if MIME type is not known
|
||||
*/
|
||||
|
||||
function file_type ($file, $relatives = array (RELATIVE_CURRENT))
|
||||
function file_type ($file, $relatives = '')
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($file, array ($relatives[0]));
|
||||
|
||||
if (!$this->acl_check ($p->fake_full_path, array ($p->mask), PHPGW_ACL_READ, True))
|
||||
@ -1904,10 +1995,15 @@
|
||||
@result Boolean True/False
|
||||
*/
|
||||
|
||||
function file_exists ($string, $relatives = array (RELATIVE_CURRENT))
|
||||
function file_exists ($string, $relatives = '')
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($string, array ($relatives[0]));
|
||||
|
||||
if ($p->outside)
|
||||
@ -1938,10 +2034,15 @@
|
||||
@result Size of $string in bytes
|
||||
*/
|
||||
|
||||
function get_size ($string, $relatives = array (RELATIVE_CURRENT), $checksubdirs = True)
|
||||
function get_size ($string, $relatives = '', $checksubdirs = True)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($string, array ($relatives[0]));
|
||||
|
||||
if (!$this->acl_check ($p->fake_full_path, array ($p->mask), PHPGW_ACL_READ, True))
|
||||
@ -1995,10 +2096,15 @@
|
||||
@result Boolean True/False
|
||||
*/
|
||||
|
||||
function checkperms ($dir, $relatives = array (RELATIVE_CURRENT))
|
||||
function checkperms ($dir, $relatives = '')
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($dir, array ($relatives[0]));
|
||||
|
||||
if (!$this->acl_check ($p->fake_full_path, array ($p->mask), PHPGW_ACL_ADD))
|
||||
@ -2026,10 +2132,15 @@
|
||||
@result array of arrays. Subarrays contain full info for each file/dir.
|
||||
*/
|
||||
|
||||
function ls ($dir = False, $relatives = array (RELATIVE_CURRENT), $checksubdirs = True, $mime_type = False, $nofiles = False, $orderby = "directory")
|
||||
function ls ($dir = False, $relatives = '', $checksubdirs = True, $mime_type = False, $nofiles = False, $orderby = "directory")
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($dir, array ($relatives[0]));
|
||||
$dir = $p->fake_full_path;
|
||||
|
||||
@ -2155,7 +2266,7 @@
|
||||
@abstract shortcut to ls
|
||||
*/
|
||||
|
||||
function dir ($dir = False, $relatives = array (RELATIVE_CURRENT), $checksubdirs = True, $mime_type = False, $nofiles = False, $orderby = "directory")
|
||||
function dir ($dir = False, $relatives = '', $checksubdirs = True, $mime_type = False, $nofiles = False, $orderby = "directory")
|
||||
{
|
||||
return $this->ls ($dir, $relatives, $checksubdirs, $mime_type, $nofiles, $orderby);
|
||||
}
|
||||
@ -2264,10 +2375,15 @@
|
||||
@result Boolean True/False
|
||||
*/
|
||||
|
||||
function update_real ($string, $relatives = array (RELATIVE_CURRENT))
|
||||
function update_real ($string, $relatives = '')
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($string, array ($relatives[0]));
|
||||
|
||||
if (file_exists ($p->real_full_path))
|
||||
@ -2320,10 +2436,15 @@
|
||||
/* Helper functions */
|
||||
|
||||
/* This fetchs all available file system information for $string (not using the database) */
|
||||
function get_real_info ($string, $relatives = array (RELATIVE_CURRENT))
|
||||
function get_real_info ($string, $relatives = '')
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (!is_array ($relatives))
|
||||
{
|
||||
$relatives = array (RELATIVE_CURRENT);
|
||||
}
|
||||
|
||||
$p = $this->path_parts ($string, array ($relatives[0]));
|
||||
|
||||
if (is_dir ($p->real_full_path))
|
||||
|
Loading…
Reference in New Issue
Block a user