diff options
| author | Juuso Lapinlampi <wub@partyvan.eu> | 2016-05-27 10:58:54 +0200 |
|---|---|---|
| committer | Juuso Lapinlampi <wub@partyvan.eu> | 2016-05-29 13:43:17 +0200 |
| commit | 2933ff1b06223a96b27d8e78ba5c04ab43806b55 (patch) | |
| tree | 6fbb7f07685c27880823420c9c6250eeb9f87e35 /static/classes | |
| parent | 5337198d9cdad99380057ec3df8fdb83892c0865 (diff) | |
Response: Deprecate HTML and text responses
HTML and text responses were introduced by Eliot to Pomf 2.0 primarily
for the JavaScript-free uploader (which is also deprecated).
I can't imagine any sane tool preferring to have either of these flawed
responses over JSON or CSV. They increase code complexity and
duplication. Let them fall off.
ewhal fell off.
Cc: Eliot Whalan <ewhal@pantsu.cat>
Diffstat (limited to 'static/classes')
| -rwxr-xr-x | static/classes/Response.class.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/static/classes/Response.class.php b/static/classes/Response.class.php index 48b9b58..03dfad7 100755 --- a/static/classes/Response.class.php +++ b/static/classes/Response.class.php @@ -58,6 +58,7 @@ class Response $this->type = $response_type; break; case 'html': + // Deprecated since version 2.1.0 header('Content-Type: text/html; charset=UTF-8'); $this->type = $response_type; break; @@ -71,6 +72,7 @@ class Response $this->type = 'text'; break; case 'text': + // Deprecated since version 2.1.0 header('Content-Type: text/plain; charset=UTF-8'); $this->type = $response_type; break; @@ -98,12 +100,14 @@ class Response $response = $this->csv_error($desc); break; case 'html': + // Deprecated since version 2.1.0 $response = $this->html_error($code, $desc); break; case 'json': $response = $this->json_error($code, $desc); break; case 'text': + // Deprecated since version 2.1.0 $response = $this->text_error($code, $desc); break; } @@ -127,12 +131,14 @@ class Response $response = $this->csv_success($files); break; case 'html': + // Deprecated since version 2.1.0 $response = $this->html_success($files); break; case 'json': $response = $this->json_success($files); break; case 'text': + // Deprecated since version 2.1.0 $response = $this->text_success($files); break; } @@ -176,7 +182,8 @@ class Response /** * Indicates with HTML body the request was invalid. * - * @deprecated 2.1.0 Will be renamed to camelCase format. + * @deprecated 2.1.0 May be removed in a major release or renamed to + * camelCase format. * @param int $code HTTP status code number. * @param int $description Descriptive error message. * @return string Error message in HTML format. @@ -189,7 +196,8 @@ class Response /** * Indicates with HTML body the request was successful. * - * @deprecated 2.1.0 Will be renamed to camelCase format. + * @deprecated 2.1.0 May be removed in a major release or renamed to + * camelCase format. * @param mixed[] $files * @return string Success message in HTML format. */ @@ -239,7 +247,8 @@ class Response /** * Indicates with plain text body the request was invalid. * - * @deprecated 2.1.0 Will be renamed to camelCase format. + * @deprecated 2.1.0 May be removed in a major release or renamed to + * camelCase format. * @param int $code HTTP status code number. * @param int $description Descriptive error message. * @return string Error message in plain text format. @@ -252,7 +261,8 @@ class Response /** * Indicates with plain text body the request was successful. * - * @deprecated 2.1.0 Will be renamed to camelCase format. + * @deprecated 2.1.0 May be removed in a major release or renamed to + * camelCase format. * @param mixed[] $files * @return string Success message in plain text format. */ |
