Installer: Support reverting asset publication

This commit is contained in:
Franz Liedke 2019-01-31 22:43:07 +01:00
parent 8ad326941f
commit ed9591c16f
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View File

@ -11,10 +11,11 @@
namespace Flarum\Install\Steps;
use Flarum\Install\ReversibleStep;
use Flarum\Install\Step;
use Illuminate\Filesystem\Filesystem;
class PublishAssets implements Step
class PublishAssets implements Step, ReversibleStep
{
/**
* @var string
@ -41,7 +42,17 @@ class PublishAssets implements Step
{
(new Filesystem)->copyDirectory(
"$this->basePath/vendor/components/font-awesome/webfonts",
"$this->assetPath/fonts"
$this->targetPath()
);
}
public function revert()
{
(new Filesystem)->deleteDirectory($this->targetPath());
}
private function targetPath()
{
return "$this->assetPath/fonts";
}
}