* @note We use a stream wrapper because it is the most secure way to handle
* decrypted content transfers. There is no safe way to decrypt the entire file
* somewhere on the server, so we have to encrypt and decrypt blocks on the fly.
@ -179,7 +179,7 @@ class Stream {
}
/**
* @brief Returns the current position of the file pointer
* Returns the current position of the file pointer
* @return int position of the file pointer
*/
public function stream_tell() {
@ -246,7 +246,7 @@ class Stream {
}
/**
* @brief Encrypt and pad data ready for writing to disk
* Encrypt and pad data ready for writing to disk
* @param string $plainData data to be encrypted
* @param string $key key to use for encryption
* @return string encrypted data on success, false on failure
@ -267,7 +267,7 @@ class Stream {
}
/**
* @brief Fetch the plain encryption key for the file and set it as plainKey property
* Fetch the plain encryption key for the file and set it as plainKey property
* @internal param bool $generate if true, a new key will be generated if none can be found
* @return bool true on key found and set, false on key not found and new key generated and set
*/
@ -318,7 +318,7 @@ class Stream {
}
/**
* @brief Handle plain data from the stream, and write it in 8192 byte blocks
* Handle plain data from the stream, and write it in 8192 byte blocks
* @param string $data data to be written to disk
* @note the data will be written to the path stored in the stream handle, set in stream_open()
* @note $data is only ever be a maximum of 8192 bytes long. This is set by PHP internally. stream_write() is called multiple times in a loop on data larger than 8192 bytes
@ -206,7 +206,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
* @brief Test that data that is written by the crypto stream wrapper
* Test that data that is written by the crypto stream wrapper
* @note Encrypted data is manually prepared and decrypted here to avoid dependency on success of stream_read
* @note If this test fails with truncate content, check that enough array slices are being rejoined to form $e, as the crypt.php file may have gotten longer and broken the manual
* reassembly of its data
@ -293,7 +293,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
* @brief Test that data that is read by the crypto stream wrapper
* Test that data that is read by the crypto stream wrapper
*/
function testSymmetricStreamDecryptShortFileContent() {
@ -388,7 +388,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
* @brief test decryption using legacy blowfish method
* test decryption using legacy blowfish method
*/
function testLegacyDecryptShort() {
@ -402,7 +402,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
* @brief test decryption using legacy blowfish method
* test decryption using legacy blowfish method
*/
function testLegacyDecryptLong() {
@ -660,7 +660,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
* @param array $args array with param=>value, will be appended to the returned url
@ -68,7 +68,7 @@ class OC_Helper {
}
/**
* @brief Creates an absolute url
* Creates an absolute url
* @param string $app app
* @param string $file file
* @param array $args array with param=>value, will be appended to the returned url
@ -84,7 +84,7 @@ class OC_Helper {
}
/**
* @brief Makes an $url absolute
* Makes an $url absolute
* @param string $url the url
* @return string the absolute url
*
@ -95,7 +95,7 @@ class OC_Helper {
}
/**
* @brief Creates an url for remote use
* Creates an url for remote use
* @param string $service id
* @return string the url
*
@ -106,7 +106,7 @@ class OC_Helper {
}
/**
* @brief Creates an absolute url for remote use
* Creates an absolute url for remote use
* @param string $service id
* @param bool $add_slash
* @return string the url
@ -121,7 +121,7 @@ class OC_Helper {
}
/**
* @brief Creates an absolute url for public use
* Creates an absolute url for public use
* @param string $service id
* @param bool $add_slash
* @return string the url
@ -138,7 +138,7 @@ class OC_Helper {
}
/**
* @brief Creates path to an image
* Creates path to an image
* @param string $app app
* @param string $image image name
* @return string the url
@ -150,7 +150,7 @@ class OC_Helper {
}
/**
* @brief get path to icon of file type
* get path to icon of file type
* @param string $mimetype mimetype
* @return string the url
*
@ -264,7 +264,7 @@ class OC_Helper {
}
/**
* @brief get path to preview of file
* get path to preview of file
* @param string $path path
* @return string the url
*
@ -279,7 +279,7 @@ class OC_Helper {
}
/**
* @brief Make a human file size
* Make a human file size
* @param int $bytes file size in bytes
* @return string a human readable file size
*
@ -314,7 +314,7 @@ class OC_Helper {
}
/**
* @brief Make a php file size
* Make a php file size
* @param int $bytes file size in bytes
* @return string a php parseable file size
*
@ -340,7 +340,7 @@ class OC_Helper {
}
/**
* @brief Make a computer file size
* Make a computer file size
* @param string $str file size in human readable format
* @return int a file size in bytes
*
@ -377,7 +377,7 @@ class OC_Helper {
}
/**
* @brief Recursive copying of folders
* Recursive copying of folders
* @param string $src source folder
* @param string $dest target folder
*
@ -399,7 +399,7 @@ class OC_Helper {
}
/**
* @brief Recursive deletion of folders
* Recursive deletion of folders
* @param string $dir path to the folder
* @return bool
*/
@ -485,7 +485,7 @@ class OC_Helper {
}
/**
* @brief Checks $_REQUEST contains a var for the $s key. If so, returns the html-escaped value of this var; otherwise returns the default value provided by $d.
* Checks $_REQUEST contains a var for the $s key. If so, returns the html-escaped value of this var; otherwise returns the default value provided by $d.
* @param string $s name of the var to escape, if set.
* @param string $d default value.
* @return string the print-safe value.
@ -726,7 +726,7 @@ class OC_Helper {
}
/**
* @brief Checks if $sub is a subdirectory of $parent
* Checks if $sub is a subdirectory of $parent
*
* @param string $sub
* @param string $parent
@ -752,7 +752,7 @@ class OC_Helper {
}
/**
* @brief Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
* Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
*
* @param array $input The array to work on
* @param int $case Either MB_CASE_UPPER or MB_CASE_LOWER (default)
@ -773,7 +773,7 @@ class OC_Helper {
}
/**
* @brief replaces a copy of string delimited by the start and (optionally) length parameters with the string given in replacement.
* replaces a copy of string delimited by the start and (optionally) length parameters with the string given in replacement.
*
* @param string $string
* @param string $replacement The replacement string.
@ -794,7 +794,7 @@ class OC_Helper {
}
/**
* @brief Replace all occurrences of the search string with the replacement string
* Replace all occurrences of the search string with the replacement string
*
* @param string $search The value being searched for, otherwise known as the needle.
* @param string $replace The replacement
@ -816,7 +816,7 @@ class OC_Helper {
}
/**
* @brief performs a search in a nested array
* performs a search in a nested array
* @param array $haystack the array to be searched
* @param string $needle the search string
* @param string $index optional, only search this key name
@ -858,7 +858,7 @@ class OC_Helper {
}
/**
* @brief calculates the maximum upload size respecting system settings, free space and user quota
* calculates the maximum upload size respecting system settings, free space and user quota
*
* @param string $dir the current folder where the user currently operates
* @param int $freeSpace the number of bytes free on the storage holding $dir, if not set this will be received from the storage directly
@ -873,7 +873,7 @@ class OC_Helper {
/**
* Calculate free space left within user quota
*
*
* @param string $dir the current folder where the user currently operates
* @param string|null $filePath The path to a local image file.
* @return string The mime type if the it could be determined, otherwise an empty string.
*/
@ -48,7 +48,7 @@ class OC_Image {
}
/**
* @brief Constructor.
* Constructor.
* @param resource|string $imageRef The path to a local file, a base64 encoded string or a resource created by
* an imagecreate* function.
* @return \OC_Image False on error
@ -70,7 +70,7 @@ class OC_Image {
}
/**
* @brief Determine whether the object contains an image resource.
* Determine whether the object contains an image resource.
* @return bool
*/
public function valid() { // apparently you can't name a method 'empty'...
@ -78,7 +78,7 @@ class OC_Image {
}
/**
* @brief Returns the MIME type of the image or an empty string if no image is loaded.
* Returns the MIME type of the image or an empty string if no image is loaded.
* @return string
*/
public function mimeType() {
@ -86,7 +86,7 @@ class OC_Image {
}
/**
* @brief Returns the width of the image or -1 if no image is loaded.
* Returns the width of the image or -1 if no image is loaded.
* @return int
*/
public function width() {
@ -94,7 +94,7 @@ class OC_Image {
}
/**
* @brief Returns the height of the image or -1 if no image is loaded.
* Returns the height of the image or -1 if no image is loaded.
* @return int
*/
public function height() {
@ -102,7 +102,7 @@ class OC_Image {
}
/**
* @brief Returns the width when the image orientation is top-left.
* Returns the width when the image orientation is top-left.
* @return int
*/
public function widthTopLeft() {
@ -125,7 +125,7 @@ class OC_Image {
}
/**
* @brief Returns the height when the image orientation is top-left.
* Returns the height when the image orientation is top-left.
* @return int
*/
public function heightTopLeft() {
@ -148,7 +148,7 @@ class OC_Image {
}
/**
* @brief Outputs the image.
* Outputs the image.
* @param string $mimeType
* @return bool
*/
@ -161,7 +161,7 @@ class OC_Image {
}
/**
* @brief Saves the image.
* Saves the image.
* @param string $filePath
* @param string $mimeType
* @return bool
@ -181,7 +181,7 @@ class OC_Image {
}
/**
* @brief Outputs/saves the image.
* Outputs/saves the image.
* @param string $filePath
* @param string $mimeType
* @return bool
@ -259,7 +259,7 @@ class OC_Image {
}
/**
* @brief Prints the image when called as $image().
* Prints the image when called as $image().
*/
public function __invoke() {
return $this->show();
@ -307,7 +307,7 @@ class OC_Image {
/**
* (I'm open for suggestions on better method name ;)
* @brief Get the orientation based on EXIF data.
* Get the orientation based on EXIF data.
* @return int The orientation or -1 if no EXIF data is available.
*/
public function getOrientation() {
@ -335,7 +335,7 @@ class OC_Image {
/**
* (I'm open for suggestions on better method name ;)
* @brief Fixes orientation based on EXIF data.
* Fixes orientation based on EXIF data.
* @return bool.
*/
public function fixOrientation() {
@ -396,7 +396,7 @@ class OC_Image {
}
/**
* @brief Loads an image from a local file, a base64 encoded string or a resource created by an imagecreate* function.
* Loads an image from a local file, a base64 encoded string or a resource created by an imagecreate* function.
* @param resource|string $imageRef The path to a local file, a base64 encoded string or a resource created by an imagecreate* function or a file resource (file handle ).
* @return resource|false An image resource or false on error
*/
@ -421,7 +421,7 @@ class OC_Image {
}
/**
* @brief Loads an image from an open file handle.
* Loads an image from an open file handle.
* It is the responsibility of the caller to position the pointer at the correct place and to close the handle again.
* @param resource $handle
* @return resource|false An image resource or false on error
@ -435,7 +435,7 @@ class OC_Image {
}
/**
* @brief Loads an image from a local file.
* Loads an image from a local file.
* @param bool|string $imagePath The path to a local file.
* @return bool|resource An image resource or false on error
*/
@ -536,7 +536,7 @@ class OC_Image {
}
/**
* @brief Loads an image from a string of data.
* Loads an image from a string of data.
* @param string $str A string of image data as read from a file.
* @return bool|resource An image resource or false on error
*/
@ -561,7 +561,7 @@ class OC_Image {
}
/**
* @brief Loads an image from a base64 encoded string.
* Loads an image from a base64 encoded string.
* @param string $str A string base64 encoded string of image data.
* @return bool|resource An image resource or false on error
*/
@ -729,7 +729,7 @@ class OC_Image {
}
/**
* @brief Resizes the image preserving ratio.
* Resizes the image preserving ratio.
* @param integer $maxSize The maximum size of either the width or height.
* @return bool
*/
@ -793,7 +793,7 @@ class OC_Image {
}
/**
* @brief Crops the image to the middle square. If the image is already square it just returns.
* Crops the image to the middle square. If the image is already square it just returns.
* @param int $size maximum size for the result (optional)
* @return bool for success or failure
*/
@ -852,7 +852,7 @@ class OC_Image {
}
/**
* @brief Crops the image from point $x$y with dimension $wx$h.
* Crops the image from point $x$y with dimension $wx$h.
* @param int $x Horizontal position
* @param int $y Vertical position
* @param int $w Width
@ -882,7 +882,7 @@ class OC_Image {
}
/**
* @brief Resizes the image to fit within a boundry while preserving ratio.
* Resizes the image to fit within a boundry while preserving ratio.