Plugin filenames must match class names

changed deprecated public values in ManiaControl.php to private
This commit is contained in:
Jocy
2017-04-02 16:20:16 +02:00
parent 2e94928539
commit 1b110e5d17
11 changed files with 135 additions and 111 deletions

View File

@ -4,6 +4,7 @@ namespace ManiaControl\Files;
use ManiaControl\Logger;
use ManiaControl\Utils\Formatter;
use ManiaControl\Utils\SystemUtil;
use ManiaControl\Utils\WebReader;
/**
@ -207,4 +208,23 @@ abstract class FileUtil {
$extension = substr($fileName, -4);
return (strtolower($extension) === '.php');
}
/**
* Returns the file name of a path to a PHP file
*
* @param $path
* @return string
*/
public static function getFileName($path) {
$className = '';
$splitNameSpace = explode(DIRECTORY_SEPARATOR, $path);
if (is_array($splitNameSpace)) {
$className = end($splitNameSpace);
}
$className = str_replace('.php', '', $className);
return $className;
}
}