Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
4dabe605
Commit
4dabe605
authored
Jan 22, 2014
by
Vladimir Zbrailov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added use http_get_request_headers and use getHeaders method in Gii module
parent
a42710ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
RequestPanel.php
extensions/debug/panels/RequestPanel.php
+8
-6
Request.php
framework/web/Request.php
+8
-3
No files found.
extensions/debug/panels/RequestPanel.php
View file @
4dabe605
...
@@ -36,13 +36,15 @@ class RequestPanel extends Panel
...
@@ -36,13 +36,15 @@ class RequestPanel extends Panel
public
function
save
()
public
function
save
()
{
{
if
(
function_exists
(
'apache_request_headers'
))
{
$headers
=
Yii
::
$app
->
getRequest
()
->
getHeaders
();
$requestHeaders
=
apache_request_headers
();
foreach
(
$headers
as
$name
=>
$value
)
{
}
elseif
(
function_exists
(
'http_get_request_headers'
))
{
if
(
is_array
(
$value
)
&&
count
(
$value
)
==
1
)
{
$requestHeaders
=
http_get_request_headers
();
$requestHeaders
[
$name
]
=
current
(
$value
);
}
else
{
}
else
{
$requestHeaders
=
[];
$requestHeaders
[
$name
]
=
$value
;
}
}
}
$responseHeaders
=
[];
$responseHeaders
=
[];
foreach
(
headers_list
()
as
$header
)
{
foreach
(
headers_list
()
as
$header
)
{
if
((
$pos
=
strpos
(
$header
,
':'
))
!==
false
)
{
if
((
$pos
=
strpos
(
$header
,
':'
))
!==
false
)
{
...
...
framework/web/Request.php
View file @
4dabe605
...
@@ -182,11 +182,11 @@ class Request extends \yii\base\Request
...
@@ -182,11 +182,11 @@ class Request extends \yii\base\Request
{
{
if
(
$this
->
_headers
===
null
)
{
if
(
$this
->
_headers
===
null
)
{
$this
->
_headers
=
new
HeaderCollection
;
$this
->
_headers
=
new
HeaderCollection
;
$headers
=
[];
if
(
function_exists
(
'getallheaders'
))
{
if
(
function_exists
(
'getallheaders'
))
{
$headers
=
getallheaders
();
$headers
=
getallheaders
();
foreach
(
$headers
as
$name
=>
$value
)
{
}
elseif
(
function_exists
(
'http_get_request_headers'
))
{
$this
->
_headers
->
add
(
$name
,
$value
);
$headers
=
http_get_request_headers
();
}
}
else
{
}
else
{
foreach
(
$_SERVER
as
$name
=>
$value
)
{
foreach
(
$_SERVER
as
$name
=>
$value
)
{
if
(
substr
(
$name
,
0
,
5
)
==
'HTTP_'
)
{
if
(
substr
(
$name
,
0
,
5
)
==
'HTTP_'
)
{
...
@@ -194,8 +194,13 @@ class Request extends \yii\base\Request
...
@@ -194,8 +194,13 @@ class Request extends \yii\base\Request
$this
->
_headers
->
add
(
$name
,
$value
);
$this
->
_headers
->
add
(
$name
,
$value
);
}
}
}
}
return
$this
->
_headers
;
}
foreach
(
$headers
as
$name
=>
$value
)
{
$this
->
_headers
->
add
(
$name
,
$value
);
}
}
}
}
return
$this
->
_headers
;
return
$this
->
_headers
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment