removed unnecessary method
This commit is contained in:
parent
9c028fbf23
commit
e23c795fc9
@ -152,7 +152,7 @@ abstract class FileUtil {
|
|||||||
* @param mixed $pluginFileNames
|
* @param mixed $pluginFileNames
|
||||||
*/
|
*/
|
||||||
public static function cleanPluginFiles($pluginFileNames) {
|
public static function cleanPluginFiles($pluginFileNames) {
|
||||||
$pluginFileNames = self::buildFileNamesArray($pluginFileNames);
|
$pluginFileNames = (array)$pluginFileNames;
|
||||||
$fileNames = array();
|
$fileNames = array();
|
||||||
foreach ($pluginFileNames as $pluginFileName) {
|
foreach ($pluginFileNames as $pluginFileName) {
|
||||||
$fileName = 'plugins' . DIRECTORY_SEPARATOR . $pluginFileName;
|
$fileName = 'plugins' . DIRECTORY_SEPARATOR . $pluginFileName;
|
||||||
@ -161,26 +161,13 @@ abstract class FileUtil {
|
|||||||
self::cleanFiles($fileNames);
|
self::cleanFiles($fileNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Make sure we're dealing with an Array of File Names
|
|
||||||
*
|
|
||||||
* @param mixed $fileNamesParam
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
private static function buildFileNamesArray($fileNamesParam) {
|
|
||||||
if (!is_array($fileNamesParam)) {
|
|
||||||
$fileNamesParam = array($fileNamesParam);
|
|
||||||
}
|
|
||||||
return $fileNamesParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to delete the given Files
|
* Try to delete the given Files
|
||||||
*
|
*
|
||||||
* @param mixed $fileNames
|
* @param mixed $fileNames
|
||||||
*/
|
*/
|
||||||
public static function cleanFiles($fileNames) {
|
public static function cleanFiles($fileNames) {
|
||||||
$fileNames = self::buildFileNamesArray($fileNames);
|
$fileNames = (array)$fileNames;
|
||||||
foreach ($fileNames as $fileName) {
|
foreach ($fileNames as $fileName) {
|
||||||
$filePath = ManiaControlDir . $fileName;
|
$filePath = ManiaControlDir . $fileName;
|
||||||
if (file_exists($filePath) && is_writeable($filePath)) {
|
if (file_exists($filePath) && is_writeable($filePath)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user