Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2893074
PhabricatorXHProfDropController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorXHProfDropController.php
View Options
<?php
final
class
PhabricatorXHProfDropController
extends
PhabricatorXHProfController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
(
)
;
if
(
!
$request
->
validateCSRF
(
)
)
{
return
new
Aphront400Response
(
)
;
}
$cancel_uri
=
$this
->
getApplicationURI
(
)
;
$ids
=
$request
->
getStrList
(
'h'
)
;
if
(
$ids
)
{
$files
=
id
(
new
PhabricatorFileQuery
(
)
)
->
setViewer
(
$viewer
)
->
withIDs
(
$ids
)
->
setRaisePolicyExceptions
(
true
)
->
execute
(
)
;
}
else
{
$files
=
array
(
)
;
}
if
(
!
$files
)
{
return
$this
->
newDialog
(
)
->
setTitle
(
pht
(
'Nothing Uploaded'
)
)
->
appendParagraph
(
pht
(
'Drag and drop .xhprof files to import them.'
)
)
->
addCancelButton
(
$cancel_uri
,
pht
(
'Done'
)
)
;
}
$samples
=
array
(
)
;
foreach
(
$files
as
$file
)
{
$sample
=
PhabricatorXHProfSample
::
initializeNewSample
(
)
->
setFilePHID
(
$file
->
getPHID
(
)
)
->
setUserPHID
(
$viewer
->
getPHID
(
)
)
->
save
(
)
;
$samples
[
]
=
$sample
;
}
if
(
count
(
$samples
)
==
1
)
{
$event
=
head
(
$samples
)
;
$next_uri
=
$event
->
getURI
(
)
;
}
else
{
$next_uri
=
$this
->
getApplicationURI
(
)
;
}
return
id
(
new
AphrontRedirectResponse
(
)
)
->
setURI
(
$next_uri
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 17:48 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127130
Default Alt Text
PhabricatorXHProfDropController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment