summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/config.php27
-rw-r--r--lib/public/files.php2
-rw-r--r--lib/public/image.php29
-rw-r--r--lib/public/template.php5
-rw-r--r--lib/public/user.php16
-rw-r--r--lib/public/util.php9
6 files changed, 71 insertions, 17 deletions
diff --git a/lib/public/config.php b/lib/public/config.php
index 8076d640b49..73476d7551d 100644
--- a/lib/public/config.php
+++ b/lib/public/config.php
@@ -49,7 +49,7 @@ class Config {
* $default will be returned.
*/
public static function getSystemValue( $key, $default = null ) {
- return(\OC_Config::getValue( $key, $default ));
+ return \OC_Config::getValue( $key, $default );
}
/**
@@ -62,7 +62,12 @@ class Config {
* not be written, false will be returned.
*/
public static function setSystemValue( $key, $value ) {
- return(\OC_Config::setValue( $key, $value ));
+ try {
+ \OC_Config::setValue( $key, $value );
+ } catch (Exception $e) {
+ return false;
+ }
+ return true;
}
/**
@@ -76,7 +81,7 @@ class Config {
* not exist the default value will be returned
*/
public static function getAppValue( $app, $key, $default = null ) {
- return(\OC_Appconfig::getValue( $app, $key, $default ));
+ return \OC_Appconfig::getValue( $app, $key, $default );
}
/**
@@ -89,7 +94,12 @@ class Config {
* Sets a value. If the key did not exist before it will be created.
*/
public static function setAppValue( $app, $key, $value ) {
- return(\OC_Appconfig::setValue( $app, $key, $value ));
+ try {
+ \OC_Appconfig::setValue( $app, $key, $value );
+ } catch (Exception $e) {
+ return false;
+ }
+ return true;
}
/**
@@ -104,7 +114,7 @@ class Config {
* not exist the default value will be returned
*/
public static function getUserValue( $user, $app, $key, $default = null ) {
- return(\OC_Preferences::getValue( $user, $app, $key, $default ));
+ return \OC_Preferences::getValue( $user, $app, $key, $default );
}
/**
@@ -119,6 +129,11 @@ class Config {
* will be added automagically.
*/
public static function setUserValue( $user, $app, $key, $value ) {
- return(\OC_Preferences::setValue( $user, $app, $key, $value ));
+ try {
+ \OC_Preferences::setValue( $user, $app, $key, $value );
+ } catch (Exception $e) {
+ return false;
+ }
+ return true;
}
}
diff --git a/lib/public/files.php b/lib/public/files.php
index 4975bbb7dfa..852b041eefb 100644
--- a/lib/public/files.php
+++ b/lib/public/files.php
@@ -61,7 +61,7 @@ class Files {
* @param string $query
* @return array
*/
- public function searchByMime($mimetype) {
+ static public function searchByMime($mimetype) {
return(\OC\Files\Filesystem::searchByMime( $mimetype ));
}
diff --git a/lib/public/image.php b/lib/public/image.php
new file mode 100644
index 00000000000..c6dd9a113ab
--- /dev/null
+++ b/lib/public/image.php
@@ -0,0 +1,29 @@
+<?php
+/**
+* ownCloud
+*
+* @author Bart Visscher
+* @copyright 2013 Bart Visscher <bartv@thisnet.nl>
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Affero General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
+namespace OCP;
+
+/**
+ * This class provides functions to handle images
+ */
+class Image extends \OC_Image {
+}
diff --git a/lib/public/template.php b/lib/public/template.php
index 69997ad42b6..3b1a4ed4906 100644
--- a/lib/public/template.php
+++ b/lib/public/template.php
@@ -96,12 +96,13 @@ function relative_modified_date($timestamp) {
/**
- * @brief Return a human readable outout for a file size.
+ * @brief DEPRECATED Return a human readable outout for a file size.
+ * @deprecated human_file_size() instead
* @param $byte size of a file in byte
* @returns human readable interpretation of a file size
*/
function simple_file_size($bytes) {
- return(\simple_file_size($bytes));
+ return(\human_file_size($bytes));
}
diff --git a/lib/public/user.php b/lib/public/user.php
index 9edebe0e7cf..23ff991642d 100644
--- a/lib/public/user.php
+++ b/lib/public/user.php
@@ -40,7 +40,7 @@ class User {
* @return string uid or false
*/
public static function getUser() {
- return \OC_USER::getUser();
+ return \OC_User::getUser();
}
/**
@@ -50,7 +50,7 @@ class User {
* Get a list of all users.
*/
public static function getUsers($search = '', $limit = null, $offset = null) {
- return \OC_USER::getUsers();
+ return \OC_User::getUsers($search, $limit, $offset);
}
/**
@@ -58,7 +58,7 @@ class User {
* @return string display name
*/
public static function getDisplayName($user=null) {
- return \OC_USER::getDisplayName($user);
+ return \OC_User::getDisplayName($user);
}
/**
@@ -68,7 +68,7 @@ class User {
* Get a list of all display names and user ids.
*/
public static function getDisplayNames($search = '', $limit = null, $offset = null) {
- return \OC_USER::getDisplayNames($search, $limit, $offset);
+ return \OC_User::getDisplayNames($search, $limit, $offset);
}
/**
@@ -78,7 +78,7 @@ class User {
* Checks if the user is logged in
*/
public static function isLoggedIn() {
- return \OC_USER::isLoggedIn();
+ return \OC_User::isLoggedIn();
}
/**
@@ -88,14 +88,14 @@ class User {
* @return boolean
*/
public static function userExists( $uid, $excludingBackend = null ) {
- return \OC_USER::userExists( $uid, $excludingBackend );
+ return \OC_User::userExists( $uid, $excludingBackend );
}
/**
* @brief Loggs the user out including all the session data
* Logout, destroys session
*/
public static function logout() {
- \OC_USER::logout();
+ \OC_User::logout();
}
/**
@@ -107,7 +107,7 @@ 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 );
}
/**
diff --git a/lib/public/util.php b/lib/public/util.php
index d69602f4507..693805946ea 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -78,6 +78,15 @@ class Util {
}
/**
+ * @brief get l10n object
+ * @param string $app
+ * @return OC_L10N
+ */
+ public static function getL10N( $application ) {
+ return \OC_L10N::get( $application );
+ }
+
+ /**
* @brief add a css file
* @param string $url
*/