/
PublishAssets.php
56 lines (46 loc) · 1.08 KB
/
PublishAssets.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Install\Steps;
use Flarum\Install\ReversibleStep;
use Flarum\Install\Step;
use Illuminate\Filesystem\Filesystem;
class PublishAssets implements Step, ReversibleStep
{
/**
* @var string
*/
private $vendorPath;
/**
* @var string
*/
private $assetPath;
public function __construct($vendorPath, $assetPath)
{
$this->vendorPath = $vendorPath;
$this->assetPath = $assetPath;
}
public function getMessage()
{
return 'Publishing all assets';
}
public function run()
{
(new Filesystem)->copyDirectory(
"$this->vendorPath/components/font-awesome/webfonts",
$this->targetPath()
);
}
public function revert()
{
(new Filesystem)->deleteDirectory($this->targetPath());
}
private function targetPath()
{
return "$this->assetPath/fonts";
}
}