This repository has been archived on 2019-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
2018-03-05 18:03:34 +00:00
|
|
|
<?php
|
|
|
|
|
2018-03-05 21:27:28 +00:00
|
|
|
namespace Sandpiper;
|
|
|
|
|
2018-03-05 18:03:34 +00:00
|
|
|
abstract class AbstractAction
|
|
|
|
{
|
|
|
|
public abstract function handle();
|
2018-03-10 11:02:07 +00:00
|
|
|
|
|
|
|
public function get_request_method() {
|
|
|
|
return strtolower($_SERVER["REQUEST_METHOD"]);
|
|
|
|
}
|
2018-03-05 18:03:34 +00:00
|
|
|
|
|
|
|
public function param_exists($key) {
|
|
|
|
return !empty($_GET[$key]);
|
|
|
|
}
|
|
|
|
|
2018-03-05 21:27:28 +00:00
|
|
|
public function param_get($key, $default_value) {
|
2018-03-05 18:03:34 +00:00
|
|
|
return $_GET[$key] ?? $default_value;
|
|
|
|
}
|
|
|
|
|
2018-03-05 21:27:28 +00:00
|
|
|
public function get_post_body() {
|
2018-03-05 18:03:34 +00:00
|
|
|
return file_get_contents("php://input");
|
|
|
|
}
|
|
|
|
}
|