Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0.x] Readded Http\Request::hasPut() (#10283) #10289

Merged
merged 3 commits into from
May 12, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Readded Http\Request::hasPut() (#10283).
  • Loading branch information
SidRoberts committed May 11, 2015
commit 456ea6b2ac855f08a9f694937cf59d740b409880
13 changes: 13 additions & 0 deletions phalcon/http/request.zep
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,19 @@ class Request implements RequestInterface, InjectionAwareInterface
return isset _POST[name];
}

/**
* Checks whether the PUT data has certain index
*/
public function hasPut(string! name) -> boolean
{
var put;

let put = [];
parse_str(file_get_contents("php://input"), put);

return isset put[name];
}

/**
* Checks whether $_GET superglobal has certain index
*/
Expand Down
5 changes: 5 additions & 0 deletions phalcon/http/requestinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ interface RequestInterface
*/
public function hasPost(string! name) -> boolean;

/**
* Checks whether the PUT data has certain index
*/
public function hasPut(string! name) -> boolean;

/**
* Checks whether $_GET superglobal has certain index
*/
Expand Down