phpdoc fixes for public api
This commit is contained in:
parent
516464ba94
commit
54f6f1e6b7
|
@ -36,8 +36,8 @@ namespace OCP;
|
||||||
class DB {
|
class DB {
|
||||||
/**
|
/**
|
||||||
* @brief Prepare a SQL query
|
* @brief Prepare a SQL query
|
||||||
* @param $query Query string
|
* @param string $query Query string
|
||||||
* @returns prepared SQL query
|
* @return \MDB2_Statement_Common prepared SQL query
|
||||||
*
|
*
|
||||||
* SQL query via MDB2 prepare(), needs to be execute()'d!
|
* SQL query via MDB2 prepare(), needs to be execute()'d!
|
||||||
*/
|
*/
|
||||||
|
@ -59,7 +59,7 @@ class DB {
|
||||||
* 'family' => array ('value' => 'Stefanov'),
|
* 'family' => array ('value' => 'Stefanov'),
|
||||||
* 'birth_date' => array ('value' => '1975-06-20')
|
* 'birth_date' => array ('value' => '1975-06-20')
|
||||||
* );
|
* );
|
||||||
* @returns true/false
|
* @return bool
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function insertIfNotExist($table, $input) {
|
public static function insertIfNotExist($table, $input) {
|
||||||
|
@ -69,7 +69,7 @@ class DB {
|
||||||
/**
|
/**
|
||||||
* @brief gets last value of autoincrement
|
* @brief gets last value of autoincrement
|
||||||
* @param $table string The optional table name (will replace *PREFIX*) and add sequence suffix
|
* @param $table string The optional table name (will replace *PREFIX*) and add sequence suffix
|
||||||
* @returns id
|
* @return int
|
||||||
*
|
*
|
||||||
* MDB2 lastInsertID()
|
* MDB2 lastInsertID()
|
||||||
*
|
*
|
||||||
|
|
|
@ -31,12 +31,12 @@
|
||||||
namespace OCP;
|
namespace OCP;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides convinient functions to send the correct http response headers
|
* This class provides convenient functions to send the correct http response headers
|
||||||
*/
|
*/
|
||||||
class Response {
|
class Response {
|
||||||
/**
|
/**
|
||||||
* @brief Enable response caching by sending correct HTTP headers
|
* @brief Enable response caching by sending correct HTTP headers
|
||||||
* @param $cache_time time to cache the response
|
* @param int $cache_time time to cache the response
|
||||||
* >0 cache time in seconds
|
* >0 cache time in seconds
|
||||||
* 0 and <0 enable default browser caching
|
* 0 and <0 enable default browser caching
|
||||||
* null cache indefinitly
|
* null cache indefinitly
|
||||||
|
@ -48,7 +48,7 @@ class Response {
|
||||||
/**
|
/**
|
||||||
* Checks and set Last-Modified header, when the request matches sends a
|
* Checks and set Last-Modified header, when the request matches sends a
|
||||||
* 'not modified' response
|
* 'not modified' response
|
||||||
* @param $lastModified time when the reponse was last modified
|
* @param string $lastModified time when the reponse was last modified
|
||||||
*/
|
*/
|
||||||
static public function setLastModifiedHeader( $lastModified ) {
|
static public function setLastModifiedHeader( $lastModified ) {
|
||||||
return(\OC_Response::setLastModifiedHeader( $lastModified ));
|
return(\OC_Response::setLastModifiedHeader( $lastModified ));
|
||||||
|
@ -65,7 +65,7 @@ class Response {
|
||||||
/**
|
/**
|
||||||
* Checks and set ETag header, when the request matches sends a
|
* Checks and set ETag header, when the request matches sends a
|
||||||
* 'not modified' response
|
* 'not modified' response
|
||||||
* @param $etag token to use for modification check
|
* @param string $etag token to use for modification check
|
||||||
*/
|
*/
|
||||||
static public function setETagHeader( $etag ) {
|
static public function setETagHeader( $etag ) {
|
||||||
return(\OC_Response::setETagHeader( $etag ));
|
return(\OC_Response::setETagHeader( $etag ));
|
||||||
|
@ -73,15 +73,15 @@ class Response {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Send file as response, checking and setting caching headers
|
* @brief Send file as response, checking and setting caching headers
|
||||||
* @param $filepath of file to send
|
* @param string $filepath of file to send
|
||||||
*/
|
*/
|
||||||
static public function sendFile( $filepath ) {
|
static public function sendFile( $filepath ) {
|
||||||
return(\OC_Response::sendFile( $filepath ));
|
return(\OC_Response::sendFile( $filepath ));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set reponse expire time
|
* @brief Set response expire time
|
||||||
* @param $expires date-time when the response expires
|
* @param string|\DateTime $expires date-time when the response expires
|
||||||
* string for DateInterval from now
|
* string for DateInterval from now
|
||||||
* DateTime object when to expire response
|
* DateTime object when to expire response
|
||||||
*/
|
*/
|
||||||
|
@ -91,7 +91,7 @@ class Response {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Send redirect response
|
* @brief Send redirect response
|
||||||
* @param $location to redirect to
|
* @param string $location to redirect to
|
||||||
*/
|
*/
|
||||||
static public function redirect( $location ) {
|
static public function redirect( $location ) {
|
||||||
return(\OC_Response::redirect( $location ));
|
return(\OC_Response::redirect( $location ));
|
||||||
|
|
|
@ -68,7 +68,7 @@ class Util {
|
||||||
* @brief write a message in the log
|
* @brief write a message in the log
|
||||||
* @param string $app
|
* @param string $app
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @param int level
|
* @param int $level
|
||||||
*/
|
*/
|
||||||
public static function writeLog( $app, $message, $level ) {
|
public static function writeLog( $app, $message, $level ) {
|
||||||
// call the internal log class
|
// call the internal log class
|
||||||
|
@ -77,7 +77,7 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief add a css file
|
* @brief add a css file
|
||||||
* @param url $url
|
* @param string $url
|
||||||
*/
|
*/
|
||||||
public static function addStyle( $application, $file = null ) {
|
public static function addStyle( $application, $file = null ) {
|
||||||
\OC_Util::addStyle( $application, $file );
|
\OC_Util::addStyle( $application, $file );
|
||||||
|
@ -85,8 +85,8 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief add a javascript file
|
* @brief add a javascript file
|
||||||
* @param appid $application
|
* @param string $application
|
||||||
* @param filename $file
|
* @param string $file
|
||||||
*/
|
*/
|
||||||
public static function addScript( $application, $file = null ) {
|
public static function addScript( $application, $file = null ) {
|
||||||
\OC_Util::addScript( $application, $file );
|
\OC_Util::addScript( $application, $file );
|
||||||
|
@ -94,7 +94,7 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add a custom element to the header
|
* @brief Add a custom element to the header
|
||||||
* @param string tag tag name of the element
|
* @param string $tag tag name of the element
|
||||||
* @param array $attributes array of attributes for the element
|
* @param array $attributes array of attributes for the element
|
||||||
* @param string $text the text content for the element
|
* @param string $text the text content for the element
|
||||||
*/
|
*/
|
||||||
|
@ -104,8 +104,8 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief formats a timestamp in the "right" way
|
* @brief formats a timestamp in the "right" way
|
||||||
* @param int timestamp $timestamp
|
* @param int $timestamp $timestamp
|
||||||
* @param bool dateOnly option to ommit time from the result
|
* @param bool $dateOnly option to omit time from the result
|
||||||
*/
|
*/
|
||||||
public static function formatDate( $timestamp, $dateOnly=false) {
|
public static function formatDate( $timestamp, $dateOnly=false) {
|
||||||
return(\OC_Util::formatDate( $timestamp, $dateOnly ));
|
return(\OC_Util::formatDate( $timestamp, $dateOnly ));
|
||||||
|
@ -113,11 +113,11 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates an absolute url
|
* @brief Creates an absolute url
|
||||||
* @param $app app
|
* @param string $app app
|
||||||
* @param $file file
|
* @param string $file file
|
||||||
* @param $args array with param=>value, will be appended to the returned url
|
* @param array $args array with param=>value, will be appended to the returned url
|
||||||
* The value of $args will be urlencoded
|
* The value of $args will be urlencoded
|
||||||
* @returns the url
|
* @returns string the url
|
||||||
*
|
*
|
||||||
* Returns a absolute url to the given app and file.
|
* Returns a absolute url to the given app and file.
|
||||||
*/
|
*/
|
||||||
|
@ -127,8 +127,8 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates an absolute url for remote use
|
* @brief Creates an absolute url for remote use
|
||||||
* @param $service id
|
* @param string $service id
|
||||||
* @returns the url
|
* @returns string the url
|
||||||
*
|
*
|
||||||
* Returns a absolute url to the given app and file.
|
* Returns a absolute url to the given app and file.
|
||||||
*/
|
*/
|
||||||
|
@ -138,8 +138,8 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates an absolute url for public use
|
* @brief Creates an absolute url for public use
|
||||||
* @param $service id
|
* @param string $service id
|
||||||
* @returns the url
|
* @returns string the url
|
||||||
*
|
*
|
||||||
* Returns a absolute url to the given app and file.
|
* Returns a absolute url to the given app and file.
|
||||||
*/
|
*/
|
||||||
|
@ -149,11 +149,11 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates an url
|
* @brief Creates an url
|
||||||
* @param $app app
|
* @param string $app app
|
||||||
* @param $file file
|
* @param string $file file
|
||||||
* @param $args array with param=>value, will be appended to the returned url
|
* @param array $args array with param=>value, will be appended to the returned url
|
||||||
* The value of $args will be urlencoded
|
* The value of $args will be urlencoded
|
||||||
* @returns the url
|
* @returns string the url
|
||||||
*
|
*
|
||||||
* Returns a url to the given app and file.
|
* Returns a url to the given app and file.
|
||||||
*/
|
*/
|
||||||
|
@ -163,7 +163,7 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the server host
|
* @brief Returns the server host
|
||||||
* @returns the server host
|
* @returns string the server host
|
||||||
*
|
*
|
||||||
* Returns the server host, even if the website uses one or more
|
* Returns the server host, even if the website uses one or more
|
||||||
* reverse proxies
|
* reverse proxies
|
||||||
|
@ -174,7 +174,7 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief returns the server hostname
|
* @brief returns the server hostname
|
||||||
* @returns the server hostname
|
* @returns string the server hostname
|
||||||
*
|
*
|
||||||
* Returns the server host name without an eventual port number
|
* Returns the server host name without an eventual port number
|
||||||
*/
|
*/
|
||||||
|
@ -190,8 +190,8 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the default email address
|
* @brief Returns the default email address
|
||||||
* @param $user_part the user part of the address
|
* @param string $user_part the user part of the address
|
||||||
* @returns the default email address
|
* @returns string the default email address
|
||||||
*
|
*
|
||||||
* Assembles a default email address (using the server hostname
|
* Assembles a default email address (using the server hostname
|
||||||
* and the given user part, and returns it
|
* and the given user part, and returns it
|
||||||
|
@ -210,7 +210,7 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the server protocol
|
* @brief Returns the server protocol
|
||||||
* @returns the server protocol
|
* @returns string the server protocol
|
||||||
*
|
*
|
||||||
* Returns the server protocol. It respects reverse proxy servers and load balancers
|
* Returns the server protocol. It respects reverse proxy servers and load balancers
|
||||||
*/
|
*/
|
||||||
|
@ -220,9 +220,9 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates path to an image
|
* @brief Creates path to an image
|
||||||
* @param $app app
|
* @param string $app app
|
||||||
* @param $image image name
|
* @param string $image image name
|
||||||
* @returns the url
|
* @returns string the url
|
||||||
*
|
*
|
||||||
* Returns the path to the image.
|
* Returns the path to the image.
|
||||||
*/
|
*/
|
||||||
|
@ -232,8 +232,8 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Make a human file size
|
* @brief Make a human file size
|
||||||
* @param $bytes file size in bytes
|
* @param int $bytes file size in bytes
|
||||||
* @returns a human readable file size
|
* @returns string a human readable file size
|
||||||
*
|
*
|
||||||
* Makes 2048 to 2 kB.
|
* Makes 2048 to 2 kB.
|
||||||
*/
|
*/
|
||||||
|
@ -243,8 +243,8 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Make a computer file size
|
* @brief Make a computer file size
|
||||||
* @param $str file size in a fancy format
|
* @param string $str file size in a fancy format
|
||||||
* @returns a file size in bytes
|
* @returns int a file size in bytes
|
||||||
*
|
*
|
||||||
* Makes 2kB to 2048.
|
* Makes 2kB to 2048.
|
||||||
*
|
*
|
||||||
|
@ -256,11 +256,11 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief connects a function to a hook
|
* @brief connects a function to a hook
|
||||||
* @param $signalclass class name of emitter
|
* @param string $signalclass class name of emitter
|
||||||
* @param $signalname name of signal
|
* @param string $signalname name of signal
|
||||||
* @param $slotclass class name of slot
|
* @param string $slotclass class name of slot
|
||||||
* @param $slotname name of slot
|
* @param string $slotname name of slot
|
||||||
* @returns true/false
|
* @returns bool
|
||||||
*
|
*
|
||||||
* This function makes it very easy to connect to use hooks.
|
* This function makes it very easy to connect to use hooks.
|
||||||
*
|
*
|
||||||
|
@ -272,10 +272,10 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief emitts a signal
|
* @brief emitts a signal
|
||||||
* @param $signalclass class name of emitter
|
* @param string $signalclass class name of emitter
|
||||||
* @param $signalname name of signal
|
* @param string $signalname name of signal
|
||||||
* @param $params defautl: array() array with additional data
|
* @param string $params defautl: array() array with additional data
|
||||||
* @returns true if slots exists or false if not
|
* @returns bool true if slots exists or false if not
|
||||||
*
|
*
|
||||||
* Emits a signal. To get data from the slot use references!
|
* Emits a signal. To get data from the slot use references!
|
||||||
*
|
*
|
||||||
|
@ -306,7 +306,7 @@ class Util {
|
||||||
*
|
*
|
||||||
* This function is used to sanitize HTML and should be applied on any string or array of strings before displaying it on a web page.
|
* This function is used to sanitize HTML and should be applied on any string or array of strings before displaying it on a web page.
|
||||||
*
|
*
|
||||||
* @param string or array of strings
|
* @param string|array of strings
|
||||||
* @return array with sanitized strings or a single sinitized string, depends on the input parameter.
|
* @return array with sanitized strings or a single sinitized string, depends on the input parameter.
|
||||||
*/
|
*/
|
||||||
public static function sanitizeHTML( $value ) {
|
public static function sanitizeHTML( $value ) {
|
||||||
|
@ -316,9 +316,9 @@ class Util {
|
||||||
/**
|
/**
|
||||||
* @brief Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
|
* @brief Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
|
||||||
*
|
*
|
||||||
* @param $input The array to work on
|
* @param array $input The array to work on
|
||||||
* @param $case Either MB_CASE_UPPER or MB_CASE_LOWER (default)
|
* @param int $case Either MB_CASE_UPPER or MB_CASE_LOWER (default)
|
||||||
* @param $encoding The encoding parameter is the character encoding. Defaults to UTF-8
|
* @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -330,11 +330,11 @@ class Util {
|
||||||
/**
|
/**
|
||||||
* @brief replaces a copy of string delimited by the start and (optionally) length parameters with the string given in replacement.
|
* @brief replaces a copy of string delimited by the start and (optionally) length parameters with the string given in replacement.
|
||||||
*
|
*
|
||||||
* @param $input The input string. .Opposite to the PHP build-in function does not accept an array.
|
* @param string $input The input string. .Opposite to the PHP build-in function does not accept an array.
|
||||||
* @param $replacement The replacement string.
|
* @param string $replacement The replacement string.
|
||||||
* @param $start If start is positive, the replacing will begin at the start'th offset into string. If start is negative, the replacing will begin at the start'th character from the end of string.
|
* @param int $start If start is positive, the replacing will begin at the start'th offset into string. If start is negative, the replacing will begin at the start'th character from the end of string.
|
||||||
* @param $length Length of the part to be replaced
|
* @param int $length Length of the part to be replaced
|
||||||
* @param $encoding The encoding parameter is the character encoding. Defaults to UTF-8
|
* @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -345,11 +345,11 @@ class Util {
|
||||||
/**
|
/**
|
||||||
* @brief Replace all occurrences of the search string with the replacement string
|
* @brief Replace all occurrences of the search string with the replacement string
|
||||||
*
|
*
|
||||||
* @param $search The value being searched for, otherwise known as the needle. String.
|
* @param string $search The value being searched for, otherwise known as the needle. String.
|
||||||
* @param $replace The replacement string.
|
* @param string $replace The replacement string.
|
||||||
* @param $subject The string or array being searched and replaced on, otherwise known as the haystack.
|
* @param string $subject The string or array being searched and replaced on, otherwise known as the haystack.
|
||||||
* @param $encoding The encoding parameter is the character encoding. Defaults to UTF-8
|
* @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
|
||||||
* @param $count If passed, this will be set to the number of replacements performed.
|
* @param int $count If passed, this will be set to the number of replacements performed.
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -359,10 +359,10 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief performs a search in a nested array
|
* @brief performs a search in a nested array
|
||||||
* @param haystack the array to be searched
|
* @param array $haystack the array to be searched
|
||||||
* @param needle the search string
|
* @param string $needle the search string
|
||||||
* @param $index optional, only search this key name
|
* @param int $index optional, only search this key name
|
||||||
* @return the key of the matching field, otherwise false
|
* @return mixed the key of the matching field, otherwise false
|
||||||
*/
|
*/
|
||||||
public static function recursiveArraySearch($haystack, $needle, $index = null) {
|
public static function recursiveArraySearch($haystack, $needle, $index = null) {
|
||||||
return(\OC_Helper::recursiveArraySearch($haystack, $needle, $index));
|
return(\OC_Helper::recursiveArraySearch($haystack, $needle, $index));
|
||||||
|
|
Loading…
Reference in New Issue