summaryrefslogtreecommitdiffstats
path: root/lib/public/util.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-02-05 13:36:55 +0100
committerRobin Appelman <icewind@owncloud.com>2014-02-05 13:36:55 +0100
commit1e79369338e8435952e2eda60a2cfc49bb6c4882 (patch)
tree12d3ac88978887f16e795c54873bbd6b99bb8ee5 /lib/public/util.php
parent3c1ab66edac1ba2f1b398c859cd933c410ea3d8d (diff)
parent3d88b10f201b7979f250b49b10360b3581030ec7 (diff)
downloadnextcloud-server-1e79369338e8435952e2eda60a2cfc49bb6c4882.tar.gz
nextcloud-server-1e79369338e8435952e2eda60a2cfc49bb6c4882.zip
merge master into storagestatistics-reuse
Diffstat (limited to 'lib/public/util.php')
-rw-r--r--lib/public/util.php27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/public/util.php b/lib/public/util.php
index 52874bcc954..4611e5e2650 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -88,14 +88,18 @@ class Util {
* @param Exception $ex exception to log
*/
public static function logException( $app, \Exception $ex ) {
- $message = $ex->getMessage();
+ $class = get_class($ex);
+ if ($class !== 'Exception') {
+ $message = $class . ': ';
+ }
+ $message .= $ex->getMessage();
if ($ex->getCode()) {
$message .= ' [' . $ex->getCode() . ']';
}
\OCP\Util::writeLog($app, 'Exception: ' . $message, \OCP\Util::FATAL);
if (defined('DEBUG') and DEBUG) {
// also log stack trace
- $stack = explode('#', $ex->getTraceAsString());
+ $stack = explode("\n", $ex->getTraceAsString());
// first element is empty
array_shift($stack);
foreach ($stack as $s) {
@@ -463,4 +467,23 @@ class Util {
public static function maxUploadFilesize($dir, $free = null) {
return \OC_Helper::maxUploadFilesize($dir, $free);
}
+
+ /**
+ * Calculate free space left within user quota
+ *
+ * @param $dir the current folder where the user currently operates
+ * @return number of bytes representing
+ */
+ public static function freeSpace($dir) {
+ return \OC_Helper::freeSpace($dir);
+ }
+
+ /**
+ * Calculate PHP upload limit
+ *
+ * @return number of bytes representing
+ */
+ public static function uploadLimit() {
+ return \OC_Helper::uploadLimit();
+ }
}