1
0
mirror of https://github.com/flarum/core.git synced 2025-07-18 23:31:17 +02:00

Installer: Support reverting asset publication

This commit is contained in:
Franz Liedke
2019-01-31 22:43:07 +01:00
parent 6f8707fa51
commit d4cdd11533

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";
}
}