summaryrefslogtreecommitdiff
path: root/lib/request.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fguillot@users.noreply.github.com>2014-03-09 23:21:23 -0400
committerFrédéric Guillot <fguillot@users.noreply.github.com>2014-03-09 23:21:23 -0400
commit7749b8ed569f6d27b0bb2ed4c2040e8b61ed4422 (patch)
treeee101992e87d740bdf0362e35ea040c866986f5a /lib/request.php
parent7bd4697dfca41a21f5857f83d6b29108fafb9a1e (diff)
Automatic actions
Diffstat (limited to 'lib/request.php')
-rw-r--r--lib/request.php44
1 files changed, 0 insertions, 44 deletions
diff --git a/lib/request.php b/lib/request.php
deleted file mode 100644
index 8840e7a4..00000000
--- a/lib/request.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-class Request
-{
- public function getStringParam($name, $default_value = '')
- {
- return isset($_GET[$name]) ? $_GET[$name] : $default_value;
- }
-
- public function getIntegerParam($name, $default_value = 0)
- {
- return isset($_GET[$name]) && ctype_digit($_GET[$name]) ? (int) $_GET[$name] : $default_value;
- }
-
- public function getValue($name)
- {
- $values = $this->getValues();
- return isset($values[$name]) ? $values[$name] : null;
- }
-
- public function getValues()
- {
- if (! empty($_POST)) return $_POST;
-
- $result = json_decode($this->getBody(), true);
- if ($result) return $result;
-
- return array();
- }
-
- public function getBody()
- {
- return file_get_contents('php://input');
- }
-
- public function getFileContent($name)
- {
- if (isset($_FILES[$name])) {
- return file_get_contents($_FILES[$name]['tmp_name']);
- }
-
- return '';
- }
-}