]> source.dussan.org Git - nextcloud-server.git/commitdiff
some more documentation cleanups. much more is needed.
authorFrank Karlitschek <frank@owncloud.org>
Sun, 6 May 2012 20:02:16 +0000 (22:02 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Sun, 6 May 2012 20:02:16 +0000 (22:02 +0200)
And greeting from the Atlanta airport. ;-)

lib/public/config.php
lib/public/db.php
lib/public/files.php
lib/public/json.php
lib/public/response.php
lib/public/user.php
lib/public/util.php

index 5681f20e3b33d744c8ce98f1df762b9fcdd2ecd6..43d97d993b7c891d89618d2368869ea9b944c53e 100644 (file)
@@ -33,8 +33,6 @@ namespace OCP;
 class Config {
 
 
-
-
        /**
         * @brief Gets a value from config.php
         * @param $key key
index b534756a5a07f14cf7aae25a2f45c5397cdec318..7ba98e2851e3ebc57948a07151093c4e7ec2113f 100644 (file)
@@ -44,6 +44,7 @@ class DB {
                return(\OC_DB::prepare($query));
        }
 
+
        /**
         * @brief gets last value of autoincrement
         * @param $table string The optional table name (will replace *PREFIX*) and add sequence suffix
@@ -59,9 +60,8 @@ class DB {
        }
 
 
-
        /**
-        * Start a transaction
+        * @brief Start a transaction
         */
        public static function beginTransaction(){
                return(\OC_DB::beginTransaction());
@@ -69,7 +69,7 @@ class DB {
 
 
        /**
-        * Commit the database changes done during a transaction that is in progress
+        * @brief Commit the database changes done during a transaction that is in progress
         */
        public static function commit(){
                return(\OC_DB::commit());
@@ -77,7 +77,7 @@ class DB {
 
 
        /**
-        * check if a result is an error, works with MDB2 and PDOException
+        * @brief check if a result is an error, works with MDB2 and PDOException
         * @param mixed $result
         * @return bool
         */
index f2153f33b900c1c159877e276fa6bd520a0ed77c..e11ab81e16fb1c00a84982053ffede0ed98e87b5 100644 (file)
@@ -38,7 +38,7 @@ class Files {
         * @param string $dir path to the folder
         *
         */
-       static function rmdirr($dir) {
+       static function rmdirr( $dir ) {
                \OC_Helper::rmdirr( $dir );
        }
 
@@ -49,18 +49,19 @@ class Files {
         * @return string
         * does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead
         */
-       static function getMimeType($path){
+       static function getMimeType( $path ){
                return(\OC_Helper::getMimeType( $path ));
        }
 
+
        /**
         * copy the contents of one stream to another
         * @param resource source
         * @param resource target
         * @return int the number of bytes copied
         */
-       public static function streamCopy($source,$target){
-               return(\OC_Helper::streamCopy($source,$target));
+       public static function streamCopy( $source, $target ){
+               return(\OC_Helper::streamCopy( $source, $target ));
        }
 
 
@@ -71,10 +72,11 @@ class Files {
         *
         * temporary files are automatically cleaned up after the script is finished
         */
-       public static function tmpFile($postfix=''){
-               return(\OC_Helper::tmpFile($postfix));
+       public static function tmpFile( $postfix='' ){
+               return(\OC_Helper::tmpFile( $postfix ));
        }
 
+
        /**
         * create a temporary folder with an unique filename
         * @return string
@@ -85,6 +87,7 @@ class Files {
                return(\OC_Helper::tmpFolder());
        }
 
+
        /**
         * Adds a suffix to the name in case the file exists
         *
@@ -92,23 +95,13 @@ class Files {
         * @param $filename
         * @return string
         */
-       public static function buildNotExistingFileName($path, $filename){
-               return(\OC_Helper::buildNotExistingFileName($path, $filename));
+       public static function buildNotExistingFileName( $path, $filename ){
+               return(\OC_Helper::buildNotExistingFileName( $path, $filename ));
        }
 
 
 
 
-
-
-
-
-
-
-
-
-
-
 }
 
 ?>
index 36d3bed807fc62f14b11ed01d73560c2ea6deb3a..7fc6a0b01d4a2df6f3471768d7346bcb608a690e 100644 (file)
@@ -33,57 +33,62 @@ namespace OCP;
 class JSON {
 
 
-
        /**
-       * Encode and print $data in JSON format
+       * @brief Encode and print $data in JSON format
+       * @param array $data The data to use
+       * @param string $setContentType the optional content type
        */
-       public static function encodedPrint($data,$setContentType=true){
-               return(\OC_JSON::encodedPrint($data,$setContentType));
+       public static function encodedPrint( $data, $setContentType=true ){
+               return(\OC_JSON::encodedPrint( $data, $setContentType ));
        }
 
+
        /**
-       * Check if the user is logged in, send json error msg if not
+       * @brief Check if the user is logged in, send json error msg if not
        */
        public static function checkLoggedIn(){
                return(\OC_JSON::checkLoggedIn());
        }
 
 
-
        /**
-       * Send json success msg
+       * @brief Send json success msg
+       * @param array $data The data to use
        */
-       public static function success($data = array()){
-               return(\OC_JSON::success($data));
+       public static function success( $data = array() ){
+               return(\OC_JSON::success( $data ));
        }
 
 
        /**
-       * Send json error msg
+       * @brief Send json error msg
+       * @param array $data The data to use
        */
-       public static function error($data = array()){
-               return(\OC_JSON::error($data));
+       public static function error( $data = array() ){
+               return(\OC_JSON::error( $data ));
        }
 
 
        /**
-        * set Content-Type header to jsonrequest
+        * @brief set Content-Type header to jsonrequest
+        * @param array $type The contwnt type header
         */
-       public static function setContentTypeHeader($type='application/json'){
-               return(\OC_JSON::setContentTypeHeader($type));
+       public static function setContentTypeHeader( $type='application/json' ){
+               return(\OC_JSON::setContentTypeHeader( $type ));
        }
 
 
        /**
-       * Check if the app is enabled, send json error msg if not
-       */
-       public static function checkAppEnabled($app){
-               return(\OC_JSON::checkAppEnabled($app));
+        * @brief Check if the App is enabled and send JSON error message instead
+        * @param string $app The app to check
+        */
+       public static function checkAppEnabled( $app ){
+               return(\OC_JSON::checkAppEnabled( $app ));
        }
 
 
        /**
-       * Check if the user is a admin, send json error msg if not
+       * @brief Check if the user is a admin, send json error msg if not
        */
        public static function checkAdminUser(){
                return(\OC_JSON::checkAdminUser());
index 2efa74ef840739bd2aa64c132c50f1758fc92ca9..5049b0c54cf2f9da511be60899b9659fecbe8a21 100644 (file)
@@ -40,8 +40,8 @@ class Response {
        *  0 and <0     enable default browser caching
        *  null         cache indefinitly
        */
-       static public function enableCaching($cache_time = null) {
-               return(\OC_Response::enableCaching($cache_time));
+       static public function enableCaching( $cache_time = null ) {
+               return(\OC_Response::enableCaching( $cache_time ));
        }
 
 
@@ -50,8 +50,8 @@ class Response {
        * 'not modified' response
        * @param $lastModified time when the reponse was last modified
        */
-       static public function setLastModifiedHeader($lastModified) {
-               return(\OC_Response::setLastModifiedHeader($lastModified));
+       static public function setLastModifiedHeader( $lastModified ) {
+               return(\OC_Response::setLastModifiedHeader( $lastModified ));
        }
 
 
@@ -69,8 +69,8 @@ class Response {
        * 'not modified' response
        * @param $etag token to use for modification check
        */
-       static public function setETagHeader($etag) {
-               return(\OC_Response::setETagHeader($etag));
+       static public function setETagHeader( $etag ) {
+               return(\OC_Response::setETagHeader( $etag ));
        }
 
 
@@ -78,8 +78,8 @@ class Response {
        * @brief Send file as response, checking and setting caching headers
        * @param $filepath of file to send
        */
-       static public function sendFile($filepath) {
-               return(\OC_Response::sendFile($filepath));
+       static public function sendFile( $filepath ) {
+               return(\OC_Response::sendFile( $filepath ));
        }
 
        /**
@@ -88,16 +88,16 @@ class Response {
        *  string for DateInterval from now
        *  DateTime object when to expire response
        */
-       static public function setExpiresHeader($expires) {
-               return(\OC_Response::setExpiresHeader($expires));
+       static public function setExpiresHeader( $expires ) {
+               return(\OC_Response::setExpiresHeader( $expires ));
        }
 
        /**
        * @brief Send redirect response
        * @param $location to redirect to
        */
-       static public function redirect($location) {
-               return(\OC_Response::redirect($location));
+       static public function redirect( $location ) {
+               return(\OC_Response::redirect( $location ));
        }
 
 
index c9f01d4a59787a033211b2a94d54d4d4e52f52a6..53ff8d25fc57762e2bc465ce02bc148d81a9331f 100644 (file)
@@ -63,15 +63,17 @@ class User {
                return \OC_USER::isLoggedIn();
        }
 
+
        /**
         * @brief check if a user exists
         * @param string $uid the username
         * @return boolean
         */
-       public static function userExists($uid){
-               return \OC_USER::userExists($uid);
+       public static function userExists( $uid ){
+               return \OC_USER::userExists( $uid );
        }
 
+
        /**
         * @brief Loggs the user out including all the session data
         * @returns true
@@ -82,6 +84,7 @@ class User {
                return \OC_USER::logout();
        }
 
+
        /**
         * @brief Check if the password is correct
         * @param $uid The username
@@ -91,9 +94,10 @@ class User {
         * Check if the password is correct without logging in the user
         */
        public static function checkPassword( $uid, $password ){
-               return \OC_USER::checkPassword($uid, $password);
+               return \OC_USER::checkPassword( $uid, $password );
        }
 
+
         /**
         * Check if the user is a admin, redirects to home if not
         */
@@ -101,6 +105,7 @@ class User {
                 \OC_Util::checkAdminUser();
         }
 
+
         /**
         * Check if the user is logged in, redirects to home if not. With
         * redirect URL parameter to the request URI.
@@ -110,6 +115,7 @@ class User {
         }
 
 
+
 }
 
 
index f5b8e798bb4eefe32f0d973fbc0ade2a8ba8af6d..4068d73370ddb5df4d71b84a7add361482bca2b1 100644 (file)
@@ -32,6 +32,7 @@ namespace OCP;
 
 class Util {
 
+
        // consts for Logging
        const DEBUG=0;
        const INFO=1;
@@ -39,8 +40,9 @@ class Util {
        const ERROR=3;
        const FATAL=4;
 
+
        /**
-        * get the current installed version of ownCloud
+        * @brief get the current installed version of ownCloud
         * @return array
         */
        public static function getVersion(){
@@ -49,8 +51,7 @@ class Util {
 
 
        /**
-        * send an email 
-        *
+        * @brief send an email 
         * @param string $toaddress
         * @param string $toname
         * @param string $subject
@@ -59,41 +60,40 @@ class Util {
         * @param string $fromname
         * @param bool $html
         */
-       public static function sendMail($toaddress,$toname,$subject,$mailtext,$fromaddress,$fromname,$html=0,$altbody='',$ccaddress='',$ccname='',$bcc='') {
+       public static function sendMail( $toaddress, $toname, $subject, $mailtext, $fromaddress, $fromname, $html=0, $altbody='', $ccaddress='', $ccname='', $bcc='') {
                // call the internal mail class
-               \OC_MAIL::send($toaddress,$toname,$subject,$mailtext,$fromaddress,$fromname,$html=0,$altbody='',$ccaddress='',$ccname='',$bcc='');
+               \OC_MAIL::send( $toaddress, $toname, $subject, $mailtext, $fromaddress, $fromname, $html=0, $altbody='', $ccaddress='', $ccname='', $bcc='');
        }
 
+
         /**
-        * write a message in the log
-         *
+        * @brief write a message in the log
         * @param string $app
         * @param string $message
         * @param int level
          */
-        public static function writeLog($app, $message, $level) {
+        public static function writeLog( $app, $message, $level ) {
                 // call the internal log class
-                \OC_LOG::write($app, $message, $level);
+                \OC_LOG::write( $app, $message, $level );
         }
 
 
        /**
-        * add a css file
-        *
+        * @brief add a css file
         * @param url  $url
         */
        public static function addStyle( $application, $file = null ){
-               \OC_Util::addStyle($application, $file);
+               \OC_Util::addStyle( $application, $file );
         }
 
+
        /**
-        * add a javascript file
-        *
+        * @brief add a javascript file
         * @param appid  $application
         * @param filename  $file
         */
        public static function addScript( $application, $file = null ){
-               \OC_Util::addScript($application, $file);
+               \OC_Util::addScript( $application, $file );
         }
 
        /**
@@ -103,17 +103,16 @@ class Util {
         * @param string $text the text content for the element
         */
        public static function addHeader( $tag, $attributes, $text=''){
-               \OC_Util::addHeader($tag, $attribute, $text);
+               \OC_Util::addHeader( $tag, $attribute, $text );
        }
 
        /**
-        * formats a timestamp in the "right" way
-        *
+        * @brief formats a timestamp in the "right" way
         * @param int timestamp $timestamp
         * @param bool dateOnly option to ommit time from the result
         */
        public static function formatDate( $timestamp,$dateOnly=false){
-               return(\OC_Util::formatDate($timestamp,$dateOnly));
+               return(\OC_Util::formatDate( $timestamp,$dateOnly ));
        }