定制 jcergolj/filesystem-disk-cleanup-for-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jcergolj/filesystem-disk-cleanup-for-laravel

最新稳定版本:v1.0

Composer 安装命令:

composer require jcergolj/filesystem-disk-cleanup-for-laravel

包简介

Delete old files on a specific Laravel filesystem disk.

README 文档

README

Command, that can be scheduled for deleting files based on filesystem disks older than time specified.

Installation

    composer require jcergolj/filesystem-disk-cleanup-for-laravel

Publish config file

    php artisan vendor:publish --provider="Jcergolj\FilesystemDiskCleanup\FilesystemDiskCleanupServiceProvider" --tag="config"

This is the content of the config/filesystem-disk-cleanup.php config file:

// filesystem-disk-cleanup.php
<?php

return [
    'disks' => [
        // jcergolj-test must match the name in filesystem.php disk config file
        'jcergolj-test' => [
            'delete_files_older_than_minutes' => 60 * 24 * 7,
        ],
    ],
];

Here is how the config/filesystem.php should look like with jcergolj-test disk registered.

// config/filesystem.php
<?php

return [
    'default' => env('FILESYSTEM_DISK', 'local'),

    'disks' => [

        'local' => [
            'driver' => 'local',
            'root' => storage_path('app'),
            'throw' => false,
        ],

        'jcergolj-test' [
            'driver' => 'local',
            'root' => storage_path('app/jceroglj-folder'),
            'throw' => false,
        ],

        // ...
    ],
];

The commands can be scheduled in Laravel's console kernel, just like any other command.

    // app/Console/Kernel.php
    $schedule->command('filesystem-disk:cleanup')->daily()->at('01:00');

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-01