Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
2a6a9a8c
Commit
2a6a9a8c
authored
Feb 06, 2014
by
Jörn Friedrich Dreyer
Browse files
polish documentation based on scrutinizer patches
parent
0d94da7e
Changes
150
Hide whitespace changes
Inline
Side-by-side
apps/files_encryption/hooks/hooks.php
View file @
2a6a9a8c
...
...
@@ -635,7 +635,7 @@ class Hooks {
/**
* @brief if the file was really deleted we remove the encryption keys
* @param array $params
* @return boolean
* @return boolean
|null
*/
public
static
function
postDelete
(
$params
)
{
...
...
@@ -675,7 +675,7 @@ class Hooks {
/**
* @brief remember the file which should be deleted and it's owner
* @param array $params
* @return boolean
* @return boolean
|null
*/
public
static
function
preDelete
(
$params
)
{
$path
=
$params
[
\
OC\Files\Filesystem
::
signal_param_path
];
...
...
apps/files_encryption/lib/crypt.php
View file @
2a6a9a8c
...
...
@@ -182,6 +182,7 @@ class Crypt {
* @param $data
* @param string $relPath The path of the file, relative to user/data;
* e.g. filename or /Docs/filename, NOT admin/files/filename
* @param boolean $isCatFileContent
* @return boolean
*/
public
static
function
isLegacyEncryptedContent
(
$isCatFileContent
,
$relPath
)
{
...
...
@@ -209,8 +210,8 @@ class Crypt {
/**
* @brief Symmetrically encrypt a string
* @param $plainContent
* @param $iv
* @param
string
$plainContent
* @param
string
$iv
* @param string $passphrase
* @return string encrypted file content
*/
...
...
@@ -229,9 +230,9 @@ class Crypt {
/**
* @brief Symmetrically decrypt a string
* @param $encryptedContent
* @param $iv
* @param $passphrase
* @param
string
$encryptedContent
* @param
string
$iv
* @param
string
$passphrase
* @throws \Exception
* @return string decrypted file content
*/
...
...
@@ -292,8 +293,7 @@ class Crypt {
* @brief Symmetrically encrypts a string and returns keyfile content
* @param string $plainContent content to be encrypted in keyfile
* @param string $passphrase
* @return bool|string
* @return string encrypted content combined with IV
* @return false|string encrypted content combined with IV
* @note IV need not be specified, as it will be stored in the returned keyfile
* and remain accessible therein.
*/
...
...
@@ -326,7 +326,7 @@ class Crypt {
* @param $keyfileContent
* @param string $passphrase
* @throws \Exception
* @return
bool|
string
* @return string
|false
* @internal param string $source
* @internal param string $target
* @internal param string $key the decryption key
...
...
@@ -438,7 +438,7 @@ class Crypt {
* @param $encryptedContent
* @param $shareKey
* @param $privateKey
* @return
bool
* @return
false|string
* @internal param string $plainContent content to be encrypted
* @returns string $plainContent decrypted string
* @note symmetricDecryptFileContent() can be used to decrypt files created using this method
...
...
apps/files_encryption/lib/helper.php
View file @
2a6a9a8c
...
...
@@ -103,7 +103,7 @@ class Helper {
* @brief enable recovery
*
* @param $recoveryKeyId
* @param $recoveryPassword
* @param
string
$recoveryPassword
* @internal param \OCA\Encryption\Util $util
* @internal param string $password
* @return bool
...
...
@@ -209,7 +209,7 @@ class Helper {
/**
* @brief disable recovery
*
* @param $recoveryPassword
* @param
string
$recoveryPassword
* @return bool
*/
public
static
function
adminDisableRecovery
(
$recoveryPassword
)
{
...
...
@@ -344,6 +344,7 @@ class Helper {
/**
* @brief redirect to a error page
* @param Session $session
*/
public
static
function
redirectToErrorPage
(
$session
,
$errorCode
=
null
)
{
...
...
@@ -423,6 +424,7 @@ class Helper {
/**
* @brief glob uses different pattern than regular expressions, escape glob pattern only
* @param unescaped path
* @param string $path
* @return escaped path
*/
public
static
function
escapeGlobPattern
(
$path
)
{
...
...
@@ -441,7 +443,7 @@ class Helper {
/**
* @brief get the path of the original file
* @param string $tmpFile path of the tmp file
* @return
mixed
path of the original file or false
* @return
string|false
path of the original file or false
*/
public
static
function
getPathFromTmpFile
(
$tmpFile
)
{
if
(
isset
(
self
::
$tmpFileMapping
[
$tmpFile
]))
{
...
...
apps/files_encryption/lib/keymanager.php
View file @
2a6a9a8c
...
...
@@ -170,7 +170,7 @@ class Keymanager {
* @brief retrieve keyfile for an encrypted file
* @param \OC_FilesystemView $view
* @param \OCA\Encryption\Util $util
* @param $filePath
* @param
string|false
$filePath
* @internal param \OCA\Encryption\file $string name
* @return string file key or false
* @note The keyfile returned is asymmetrically encrypted. Decryption
...
...
@@ -513,6 +513,8 @@ class Keymanager {
/**
* @brief Make preparations to vars and filesystem for saving a keyfile
* @param string|boolean $path
* @param string $basePath
*/
public
static
function
keySetPreparation
(
\
OC_FilesystemView
$view
,
$path
,
$basePath
,
$userId
)
{
...
...
@@ -542,7 +544,7 @@ class Keymanager {
/**
* @brief extract filename from share key name
* @param string $shareKey (filename.userid.sharekey)
* @return
mixed
filename or false
* @return
string|false
filename or false
*/
protected
static
function
getFilenameFromShareKey
(
$shareKey
)
{
$parts
=
explode
(
'.'
,
$shareKey
);
...
...
apps/files_encryption/lib/session.php
View file @
2a6a9a8c
...
...
@@ -195,7 +195,7 @@ class Session {
/**
* @brief Sets user legacy key to session
* @param $legacyKey
* @param
string
$legacyKey
* @return bool
*/
public
function
setLegacyKey
(
$legacyKey
)
{
...
...
apps/files_encryption/lib/util.php
View file @
2a6a9a8c
...
...
@@ -563,7 +563,7 @@ class Util {
/**
* @param $path
* @param
string
$path
* @return bool
*/
public
function
isSharedPath
(
$path
)
{
...
...
@@ -1031,7 +1031,7 @@ class Util {
* @brief Decrypt a keyfile
* @param string $filePath
* @param string $privateKey
* @return
bool
|string
* @return
false
|string
*/
private
function
decryptKeyfile
(
$filePath
,
$privateKey
)
{
...
...
@@ -1110,6 +1110,7 @@ class Util {
/**
* @brief Find, sanitise and format users sharing a file
* @note This wraps other methods into a portable bundle
* @param boolean $sharingEnabled
*/
public
function
getSharingUsersArray
(
$sharingEnabled
,
$filePath
,
$currentUserId
=
false
)
{
...
...
apps/files_encryption/tests/crypt.php
View file @
2a6a9a8c
...
...
@@ -661,7 +661,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @brief encryption using legacy blowfish method
* @param
$data
string data to encrypt
* @param string
$data
data to encrypt
* @param $passwd string password
* @return string
*/
...
...
apps/files_encryption/tests/keymanager.php
View file @
2a6a9a8c
...
...
@@ -250,6 +250,10 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
* dummy class to access protected methods of \OCA\Encryption\Keymanager for testing
*/
class
TestProtectedKeymanagerMethods
extends
\
OCA\Encryption\Keymanager
{
/**
* @param string $sharekey
*/
public
static
function
testGetFilenameFromShareKey
(
$sharekey
)
{
return
self
::
getFilenameFromShareKey
(
$sharekey
);
}
...
...
apps/files_encryption/tests/util.php
View file @
2a6a9a8c
...
...
@@ -461,7 +461,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
* helper function to set migration status to the right value
* to be able to test the migration path
*
* @param $status needed migration status for test
* @param
integer
$status needed migration status for test
* @param $user for which user the status should be set
* @return boolean
*/
...
...
apps/files_external/lib/amazons3.php
View file @
2a6a9a8c
...
...
@@ -54,6 +54,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
*/
private
$timeout
=
15
;
/**
* @param string $path
*/
private
function
normalizePath
(
$path
)
{
$path
=
trim
(
$path
,
'/'
);
...
...
apps/files_external/lib/config.php
View file @
2a6a9a8c
...
...
@@ -35,7 +35,7 @@ class OC_Mount_Config {
* If the configuration parameter is a boolean, add a '!' to the beginning of the value
* If the configuration parameter is optional, add a '&' to the beginning of the value
* If the configuration parameter is hidden, add a '#' to the beginning of the value
* @return
array
* @return
string
*/
public
static
function
getBackends
()
{
...
...
@@ -269,6 +269,10 @@ class OC_Mount_Config {
* @param string MOUNT_TYPE_GROUP | MOUNT_TYPE_USER
* @param string User or group to apply mount to
* @param bool Personal or system mount point i.e. is this being called from the personal or admin page
* @param string $mountPoint
* @param string $class
* @param string $mountType
* @param string $applicable
* @return bool
*/
public
static
function
addMountPoint
(
$mountPoint
,
...
...
@@ -344,6 +348,7 @@ class OC_Mount_Config {
/**
* Read the mount points in the config file into an array
* @param bool Personal or system config file
* @param boolean $isPersonal
* @return array
*/
private
static
function
readData
(
$isPersonal
)
{
...
...
@@ -374,6 +379,7 @@ class OC_Mount_Config {
* Write the mount points to the config file
* @param bool Personal or system config file
* @param array Mount points
* @param boolean $isPersonal
*/
private
static
function
writeData
(
$isPersonal
,
$data
)
{
if
(
$isPersonal
)
{
...
...
apps/files_external/lib/dropbox.php
View file @
2a6a9a8c
...
...
@@ -50,6 +50,9 @@ class Dropbox extends \OC\Files\Storage\Common {
}
}
/**
* @param string $path
*/
private
function
deleteMetaData
(
$path
)
{
$path
=
$this
->
root
.
$path
;
if
(
isset
(
$this
->
metaData
[
$path
]))
{
...
...
@@ -61,7 +64,7 @@ class Dropbox extends \OC\Files\Storage\Common {
/**
* @brief Returns the path's metadata
* @param $path path for which to return the metadata
* @param
string
$path path for which to return the metadata
* @param $list if true, also return the directory's contents
* @return directory contents if $list is true, file metadata if $list is
* false, null if the file doesn't exist or "false" if the operation failed
...
...
apps/files_external/lib/google.php
View file @
2a6a9a8c
...
...
@@ -67,7 +67,7 @@ class Google extends \OC\Files\Storage\Common {
/**
* Get the Google_DriveFile object for the specified path
* @param string $path
* @return Google_DriveFile
* @return Google_DriveFile
|false
*/
private
function
getDriveFile
(
$path
)
{
// Remove leading and trailing slashes
...
...
apps/files_external/lib/irods.php
View file @
2a6a9a8c
...
...
@@ -134,6 +134,7 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{
/**
* get the best guess for the modification time of an iRODS collection
* @param string $path
*/
private
function
collectionMTime
(
$path
)
{
$dh
=
$this
->
opendir
(
$path
);
...
...
apps/files_external/lib/sftp.php
View file @
2a6a9a8c
...
...
@@ -75,6 +75,9 @@ class SFTP extends \OC\Files\Storage\Common {
return
'sftp::'
.
$this
->
user
.
'@'
.
$this
->
host
.
'/'
.
$this
->
root
;
}
/**
* @param string $path
*/
private
function
absPath
(
$path
)
{
return
$this
->
root
.
$this
->
cleanPath
(
$path
);
}
...
...
@@ -277,6 +280,9 @@ class SFTP extends \OC\Files\Storage\Common {
}
}
/**
* @param string $path
*/
public
function
constructUrl
(
$path
)
{
$url
=
'sftp://'
.
$this
->
user
.
':'
.
$this
->
password
.
'@'
.
$this
->
host
.
$this
->
root
.
$path
;
return
$url
;
...
...
apps/files_external/lib/streamwrapper.php
View file @
2a6a9a8c
...
...
@@ -9,6 +9,10 @@
namespace
OC\Files\Storage
;
abstract
class
StreamWrapper
extends
Common
{
/**
* @return string|null
*/
abstract
public
function
constructUrl
(
$path
);
public
function
mkdir
(
$path
)
{
...
...
@@ -76,10 +80,17 @@ abstract class StreamWrapper extends Common {
}
}
/**
* @param string $path
* @param string $target
*/
public
function
getFile
(
$path
,
$target
)
{
return
copy
(
$this
->
constructUrl
(
$path
),
$target
);
}
/**
* @param string $target
*/
public
function
uploadFile
(
$path
,
$target
)
{
return
copy
(
$path
,
$this
->
constructUrl
(
$target
));
}
...
...
apps/files_external/lib/swift.php
View file @
2a6a9a8c
...
...
@@ -52,6 +52,9 @@ class Swift extends \OC\Files\Storage\Common {
*/
private
static
$tmpFiles
=
array
();
/**
* @param string $path
*/
private
function
normalizePath
(
$path
)
{
$path
=
trim
(
$path
,
'/'
);
...
...
@@ -62,6 +65,9 @@ class Swift extends \OC\Files\Storage\Common {
return
$path
;
}
/**
* @param string $path
*/
private
function
doesObjectExist
(
$path
)
{
try
{
$object
=
$this
->
container
->
DataObject
(
$path
);
...
...
apps/files_external/lib/webdav.php
View file @
2a6a9a8c
...
...
@@ -247,6 +247,10 @@ class DAV extends \OC\Files\Storage\Common{
return
true
;
}
/**
* @param string $path
* @param string $target
*/
public
function
getFile
(
$path
,
$target
)
{
$this
->
init
();
$source
=
$this
->
fopen
(
$path
,
'r'
);
...
...
@@ -338,6 +342,11 @@ class DAV extends \OC\Files\Storage\Common{
return
substr
(
$path
,
1
);
}
/**
* @param string $method
* @param string $path
* @param integer $expected
*/
private
function
simpleResponse
(
$method
,
$path
,
$body
,
$expected
)
{
$path
=
$this
->
cleanPath
(
$path
);
try
{
...
...
apps/files_sharing/lib/cache.php
View file @
2a6a9a8c
...
...
@@ -32,6 +32,9 @@ class Shared_Cache extends Cache {
private
$storage
;
private
$files
=
array
();
/**
* @param \OC\Files\Storage\Shared $storage
*/
public
function
__construct
(
$storage
)
{
$this
->
storage
=
$storage
;
}
...
...
apps/files_sharing/lib/permissions.php
View file @
2a6a9a8c
...
...
@@ -42,6 +42,10 @@ class Shared_Permissions extends Permissions {
}
}
/**
* @param integer $fileId
* @param string $user
*/
private
function
getFile
(
$fileId
,
$user
)
{
if
(
$fileId
==
-
1
)
{
return
\
OCP\PERMISSION_READ
;
...
...
Prev
1
2
3
4
5
…
8
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment