summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/controllers/api/v1/api_info.php2
-rw-r--r--application/controllers/api/v1/file.php3
-rw-r--r--application/helpers/filebin_helper.php12
3 files changed, 15 insertions, 2 deletions
diff --git a/application/controllers/api/v1/api_info.php b/application/controllers/api/v1/api_info.php
index abc4fd51e..cd94869f8 100644
--- a/application/controllers/api/v1/api_info.php
+++ b/application/controllers/api/v1/api_info.php
@@ -11,6 +11,6 @@ namespace controllers\api\v1;
class api_info extends \controllers\api\api_controller {
static public function get_version()
{
- return "1.3.0";
+ return "1.4.0";
}
}
diff --git a/application/controllers/api/v1/file.php b/application/controllers/api/v1/file.php
index ccc83f404..4ffc8ed48 100644
--- a/application/controllers/api/v1/file.php
+++ b/application/controllers/api/v1/file.php
@@ -47,10 +47,11 @@ class file extends \controllers\api\api_controller {
public function get_config()
{
- // TODO: return more fields?
return array(
"upload_max_size" => $this->config->item("upload_max_size"),
"max_files_per_request" => intval(ini_get("max_file_uploads")),
+ "max_input_vars" => intval(ini_get("max_input_vars")),
+ "request_max_size" => return_bytes(ini_get("post_max_size")),
);
}
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php
index c1f302da3..5e37f4b80 100644
--- a/application/helpers/filebin_helper.php
+++ b/application/helpers/filebin_helper.php
@@ -369,4 +369,16 @@ function files_are_equal($a, $b)
return $result;
}
+# Source: http://php.net/manual/en/function.ini-get.php#96996
+function return_bytes($size_str)
+{
+ switch (substr ($size_str, -1))
+ {
+ case 'K': case 'k': return (int)$size_str * 1024;
+ case 'M': case 'm': return (int)$size_str * 1048576;
+ case 'G': case 'g': return (int)$size_str * 1073741824;
+ default: return $size_str;
+ }
+}
+
# vim: set noet: