2024.8.23
Loading...
Searching...
No Matches
ActionClearFolders Class Reference

Public Member Functions

 __construct ($args)
 

Detailed Description

Handles the action of clearing specific temporary folders within the application.

This class is responsible for clearing out temporary files and directories that are not essential for immediate functionality but may accumulate over time and use disk space. It targets temporary directories used by various components like Composer, OpenSSL, and others.

Definition at line 17 of file class.action.clearFolders.php.

Constructor & Destructor Documentation

◆ __construct()

ActionClearFolders::__construct ( $args)

Constructor for the ActionClearFolders class.

Upon instantiation, it clears specified temporary folders in both the root and core temporary paths. It excludes certain files and folders from being deleted to prevent essential data loss.

Parameters
array$argsArguments that might be used for further extension of constructor functionality.

Clears specific temporary folders in the root temporary path.

Util\clearFolder is used to clear the contents of the root temporary path, excluding certain essential items such as 'cachegrind', 'composer', 'openssl', 'mailpit', 'xlight', 'npm-cache', 'pip', 'yarn', and '.gitignore'. This ensures that important data and configurations are not lost.

Parameters
string$bearsamppRoot-,>getTmpPath()The root temporary path to be cleared.
array$exclusionsList of folders and files to be excluded from deletion.

Clears the core temporary path.

Util\clearFolder is used to clear the contents of the core temporary path, excluding the '.gitignore' file. This ensures that the core temporary path is cleaned without removing the '.gitignore' file which might be necessary for version control.

Parameters
string$bearsamppCore-,>getTmpPath()The core temporary path to be cleared.
array$exclusionsList of folders and files to be excluded from deletion.

Definition at line 27 of file class.action.clearFolders.php.

28 {
30
31 /**
32 * Clears specific temporary folders in the root temporary path.
33 *
34 * Util::clearFolder is used to clear the contents of the root temporary path, excluding
35 * certain essential items such as 'cachegrind', 'composer', 'openssl', 'mailpit', 'xlight', 'npm-cache',
36 * 'pip', 'yarn', and '.gitignore'. This ensures that important data and configurations are not lost.
37 *
38 * @param string $bearsamppRoot->getTmpPath() The root temporary path to be cleared.
39 * @param array $exclusions List of folders and files to be excluded from deletion.
40 */
41 Util::clearFolder($bearsamppRoot->getTmpPath(), array('cachegrind', 'composer', 'openssl', 'mailhog', 'mailpit', 'xlight', 'npm-cache', 'pip', 'yarn', '.gitignore'));
42
43 // Clear logs
44 Util::clearFolder($bearsamppRoot->getLogsPath(), array('mailpit.err.log', 'mailpit.out.log', 'memcached.err.log', 'memcached.out.log', 'xlight.err.log', 'xlight.log', '.gitignore') );
45
46 /**
47 * Clears the core temporary path.
48 *
49 * Util::clearFolder is used to clear the contents of the core temporary path, excluding
50 * the '.gitignore' file. This ensures that the core temporary path is cleaned without
51 * removing the '.gitignore' file which might be necessary for version control.
52 *
53 * @param string $bearsamppCore->getTmpPath() The core temporary path to be cleared.
54 * @param array $exclusions List of folders and files to be excluded from deletion.
55 */
56 Util::clearFolder($bearsamppCore->getTmpPath(), array('.gitignore'));
57 }
global $bearsamppRoot
global $bearsamppCore
static clearFolder($path, $exclude=array())

References $bearsamppCore, $bearsamppRoot, and Util\clearFolder().


The documentation for this class was generated from the following file: