Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F959532
PhabricatorStorageFixtureScopeGuard.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
845 B
Referenced Files
None
Subscribers
None
PhabricatorStorageFixtureScopeGuard.php
View Options
<?php
/**
* Used by unit tests to build storage fixtures.
*/
final
class
PhabricatorStorageFixtureScopeGuard
{
private
$name
;
public
function
__construct
(
$name
)
{
$this
->
name
=
$name
;
execx
(
'php %s upgrade --force --no-adjust --namespace %s'
,
$this
->
getStorageBinPath
(),
$this
->
name
);
PhabricatorLiskDAO
::
pushStorageNamespace
(
$name
);
// Destructor is not called with fatal error.
register_shutdown_function
(
array
(
$this
,
'destroy'
));
}
public
function
destroy
()
{
PhabricatorLiskDAO
::
popStorageNamespace
();
execx
(
'php %s destroy --force --namespace %s'
,
$this
->
getStorageBinPath
(),
$this
->
name
);
}
private
function
getStorageBinPath
()
{
$root
=
dirname
(
phutil_get_library_root
(
'phabricator'
));
return
$root
.
'/scripts/sql/manage_storage.php'
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 10:11 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
228415
Default Alt Text
PhabricatorStorageFixtureScopeGuard.php (845 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment