24 lines
463 B
PHP
24 lines
463 B
PHP
<?php
|
|
|
|
namespace Sandpiper;
|
|
|
|
abstract class AbstractAction
|
|
{
|
|
public abstract function handle();
|
|
|
|
public function get_request_method() {
|
|
return strtolower($_SERVER["REQUEST_METHOD"]);
|
|
}
|
|
|
|
public function param_exists($key) {
|
|
return !empty($_GET[$key]);
|
|
}
|
|
|
|
public function param_get($key, $default_value) {
|
|
return $_GET[$key] ?? $default_value;
|
|
}
|
|
|
|
public function get_post_body() {
|
|
return file_get_contents("php://input");
|
|
}
|
|
}
|