Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ldy
/
phwoolcon
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c7eec9f6
authored
Nov 22, 2020
by
yeran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change the get post data way from
php://input
to $this->request->getPost()
1 parent
ecf085a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
src/Controller.php
src/Controller.php
View file @
c7eec9f
...
@@ -57,8 +57,9 @@ abstract class Controller extends PhalconController
...
@@ -57,8 +57,9 @@ abstract class Controller extends PhalconController
}
}
}
}
if
(
empty
(
$input
))
{
if
(
empty
(
$input
))
{
$input_string
=
file_get_contents
(
'php://input'
);
// $input_string = file_get_contents('php://input');
$input_data
=
json_decode
(
$input_string
,
true
);
// $input_data = json_decode($input_string, true);
$input_data
=
$this
->
request
->
getPost
();
if
(
is_array
(
$input_data
))
{
if
(
is_array
(
$input_data
))
{
$input
=
$input_data
;
$input
=
$input_data
;
}
else
{
}
else
{
...
@@ -142,7 +143,7 @@ abstract class Controller extends PhalconController
...
@@ -142,7 +143,7 @@ abstract class Controller extends PhalconController
}
}
}
else
{
}
else
{
$params
=
$this
->
request
->
getHeader
(
$name
);
$params
=
$this
->
request
->
getHeader
(
$name
);
if
(
$params
)
{
if
(
$params
)
{
return
$params
;
return
$params
;
}
}
if
(
false
!==
$is_validate
)
{
if
(
false
!==
$is_validate
)
{
...
@@ -186,9 +187,9 @@ abstract class Controller extends PhalconController
...
@@ -186,9 +187,9 @@ abstract class Controller extends PhalconController
* Q: Why make the `php://input` encapsulation?
* Q: Why make the `php://input` encapsulation?
* A: I want to use it in service mode, which is impossible to pass data via `php://input` between processes.
* A: I want to use it in service mode, which is impossible to pass data via `php://input` between processes.
* This is not exactly the same as the Phalcon's implementation.
* This is not exactly the same as the Phalcon's implementation.
* @see \Phalcon\Http\Request::getRawBody()
* @return string
* @return string
* @codeCoverageIgnore
* @codeCoverageIgnore
* @see \Phalcon\Http\Request::getRawBody()
*/
*/
protected
function
getRawPhpInput
()
protected
function
getRawPhpInput
()
{
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment