File_Cleanup implements Registerable, Standard_Service

A scheduled task to periodically check for unused uploaded files.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable
Standard_Service

Table of Contents

$plugin_file  : mixed
__construct()  : mixed
Constructor
register()  : mixed
Register hooks and filters.
run()  : mixed
Retrieve all orders with uploaded files and compare to existing unassociated files.
schedule()  : mixed
Schedules the event.
unschedule()  : mixed
Unschedule the event.
get_cron_hook()  : string
Get the name of the scheduled task.
get_interval()  : string
Get the interval at which the task should run.
get_order_associated_files()  : array<string|int, mixed>
Retrieves all files associated with orders.
remove_unused_files()  : void
Compare the files in the order meta to the files in the uploads directory.

Properties

Methods

__construct()

Constructor

public __construct(mixed $plugin) : mixed
Parameters
$plugin : mixed
Tags
Return values
mixed

register()

Register hooks and filters.

public register() : mixed
Tags
Return values
mixed

run()

Retrieve all orders with uploaded files and compare to existing unassociated files.

public run() : mixed
Tags
Return values
mixed

schedule()

Schedules the event.

public schedule() : mixed
Tags
Return values
mixed

unschedule()

Unschedule the event.

public unschedule() : mixed
Tags
Return values
mixed

get_cron_hook()

Get the name of the scheduled task.

protected get_cron_hook() : string
Tags
Return values
string

get_interval()

Get the interval at which the task should run.

protected get_interval() : string
Tags
Return values
string

get_order_associated_files()

Retrieves all files associated with orders.

private get_order_associated_files() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

remove_unused_files()

Compare the files in the order meta to the files in the uploads directory.

private remove_unused_files() : void
Tags
Return values
void

Search results