mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-30 00:47:22 +08:00
update backup excludes
This commit is contained in:
@@ -17,11 +17,13 @@ use Symfony\Component\Mime\Email;
|
|||||||
|
|
||||||
class ToolRepository extends BaseRepository
|
class ToolRepository extends BaseRepository
|
||||||
{
|
{
|
||||||
|
const BACKUP_EXCLUDES = ['vendor', 'node_modules', '.git', '.idea', '.settings', '.DS_Store', '.github'];
|
||||||
|
|
||||||
public function backupWeb($method = null): array
|
public function backupWeb($method = null): array
|
||||||
{
|
{
|
||||||
$webRoot = base_path();
|
$webRoot = base_path();
|
||||||
$dirName = basename($webRoot);
|
$dirName = basename($webRoot);
|
||||||
$excludes = ['vendor', 'node_modules', '.git', '.idea', '.settings', '.DS_Store', '.github'];
|
$excludes = self::BACKUP_EXCLUDES;
|
||||||
$baseFilename = sprintf('%s/%s.web.%s', sys_get_temp_dir(), $dirName, date('Ymd.His'));
|
$baseFilename = sprintf('%s/%s.web.%s', sys_get_temp_dir(), $dirName, date('Ymd.His'));
|
||||||
if (command_exists('tar') && ($method === 'tar' || $method === null)) {
|
if (command_exists('tar') && ($method === 'tar' || $method === null)) {
|
||||||
$filename = $baseFilename . ".tar.gz";
|
$filename = $baseFilename . ".tar.gz";
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ use App\Repositories\AttendanceRepository;
|
|||||||
use App\Repositories\BonusRepository;
|
use App\Repositories\BonusRepository;
|
||||||
use App\Repositories\ExamRepository;
|
use App\Repositories\ExamRepository;
|
||||||
use App\Repositories\TagRepository;
|
use App\Repositories\TagRepository;
|
||||||
|
use App\Repositories\ToolRepository;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
@@ -366,7 +367,7 @@ class Update extends Install
|
|||||||
|
|
||||||
foreach (glob("$extractDir/*") as $path) {
|
foreach (glob("$extractDir/*") as $path) {
|
||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
$excludes = ['.git', 'public/favicon.ico', '.env'];
|
$excludes = array_merge(ToolRepository::BACKUP_EXCLUDES, ['public/favicon.ico', '.env']);
|
||||||
if (!in_array('composer', $includes)) {
|
if (!in_array('composer', $includes)) {
|
||||||
$excludes[] = 'composer.lock';
|
$excludes[] = 'composer.lock';
|
||||||
$excludes[] = 'composer.json';
|
$excludes[] = 'composer.json';
|
||||||
|
|||||||
Reference in New Issue
Block a user