Differential D15744 Diff 37943 src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php
<?php | <?php | ||||
/** | /** | ||||
* Used by unit tests to build storage fixtures. | * Used by unit tests to build storage fixtures. | ||||
*/ | */ | ||||
final class PhabricatorStorageFixtureScopeGuard extends Phobject { | final class PhabricatorStorageFixtureScopeGuard extends Phobject { | ||||
private $name; | private $name; | ||||
public function __construct($name) { | public function __construct($name) { | ||||
$this->name = $name; | $this->name = $name; | ||||
execx( | execx( | ||||
'php %s upgrade --force --no-adjust --namespace %s', | 'php %s upgrade --force --namespace %s', | ||||
$this->getStorageBinPath(), | $this->getStorageBinPath(), | ||||
$this->name); | $this->name); | ||||
PhabricatorLiskDAO::pushStorageNamespace($name); | PhabricatorLiskDAO::pushStorageNamespace($name); | ||||
// Destructor is not called with fatal error. | // Destructor is not called with fatal error. | ||||
register_shutdown_function(array($this, 'destroy')); | register_shutdown_function(array($this, 'destroy')); | ||||
} | } | ||||
Show All 21 Lines |