mirror of
https://github.com/flarum/framework.git
synced 2025-03-11 21:05:25 +08:00
Installer: Support reverting asset publication
This commit is contained in:
parent
6f8707fa51
commit
d4cdd11533
@ -11,10 +11,11 @@
|
|||||||
|
|
||||||
namespace Flarum\Install\Steps;
|
namespace Flarum\Install\Steps;
|
||||||
|
|
||||||
|
use Flarum\Install\ReversibleStep;
|
||||||
use Flarum\Install\Step;
|
use Flarum\Install\Step;
|
||||||
use Illuminate\Filesystem\Filesystem;
|
use Illuminate\Filesystem\Filesystem;
|
||||||
|
|
||||||
class PublishAssets implements Step
|
class PublishAssets implements Step, ReversibleStep
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
@ -41,7 +42,17 @@ class PublishAssets implements Step
|
|||||||
{
|
{
|
||||||
(new Filesystem)->copyDirectory(
|
(new Filesystem)->copyDirectory(
|
||||||
"$this->basePath/vendor/components/font-awesome/webfonts",
|
"$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";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user