mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 16:34:23 -05:00
clean up, format code
This commit is contained in:
@@ -43,21 +43,22 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* D2Files class.
|
||||
*/
|
||||
class D2Files {
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* @var array Holds the list of files.
|
||||
*/
|
||||
public $files = [];
|
||||
|
||||
/**
|
||||
* @var
|
||||
* @var array Holds the character files.
|
||||
*/
|
||||
public $charFiles;
|
||||
|
||||
/**
|
||||
*
|
||||
* D2Files constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$filesToIgnore = [
|
||||
@@ -68,26 +69,30 @@ class D2Files {
|
||||
"treasureclass.txt",
|
||||
"treasureclassex.txt"
|
||||
];
|
||||
$glob = glob($_SESSION['path'] . '*.txt');
|
||||
|
||||
$glob = glob($_SESSION['path'] . '*.txt'); // Get a list of all ".txt" files in the specified path.
|
||||
|
||||
foreach ($glob as $g) {
|
||||
$files[] = basename($g);
|
||||
$files[] = basename($g); // Add the base name of each file to the $files array.
|
||||
}
|
||||
$this->files = array_udiff($files, $filesToIgnore, 'strcasecmp');
|
||||
return $this->files;
|
||||
|
||||
$this->files = array_udiff($files, $filesToIgnore, 'strcasecmp'); // Remove the ignored files from the list, case-insensitive.
|
||||
return $this->files; // Return the list of files.
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* Get the list of character save files.
|
||||
*
|
||||
* @return mixed The list of character save files.
|
||||
*/
|
||||
public function getSaveFiles() {
|
||||
$glob = glob($_SESSION['savepath'] . '*.d2s');
|
||||
$glob = glob($_SESSION['savepath'] . '*.d2s'); // Get a list of all ".d2s" files in the specified save path.
|
||||
|
||||
|
||||
foreach ($glob as $g) {
|
||||
$this->charFiles[] = basename($g);
|
||||
$this->charFiles[] = basename($g); // Add the base name of each file to the $charFiles array.
|
||||
}
|
||||
|
||||
return $this->charFiles;
|
||||
|
||||
return $this->charFiles; // Return the list of character save files.
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user