本文整理汇总了PHP中fs_director::GetFileExtension方法的典型用法代码示例。如果您正苦于以下问题:PHP fs_director::GetFileExtension方法的具体用法?PHP fs_director::GetFileExtension怎么用?PHP fs_director::GetFileExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fs_director
的用法示例。
在下文中一共展示了fs_director::GetFileExtension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doInstallModule
static function doInstallModule()
{
self::$error_message = "";
self::$error = false;
if ($_FILES['modulefile']['error'] > 0) {
self::$error_message = "Couldn't upload the file, " . $_FILES['modulefile']['error'] . "";
} else {
$archive_ext = fs_director::GetFileExtension($_FILES['modulefile']['name']);
$module_folder = fs_director::GetFileNameNoExtentsion($_FILES['modulefile']['name']);
$module_dir = ctrl_options::GetSystemOption('sentora_root') . 'modules/' . $module_folder;
if (!fs_director::CheckFolderExists($module_dir)) {
if ($archive_ext != 'zpp') {
self::$error_message = "Package type was not detected as a .zpp (Sentora Package) archive.";
} else {
if (fs_director::CreateDirectory($module_dir)) {
if (sys_archive::Unzip($_FILES['modulefile']['tmp_name'], $module_dir . '/')) {
if (!fs_director::CheckFileExists($module_dir . '/module.xml')) {
self::$error_message = "No module.xml file found in the unzipped archive.";
} else {
ui_module::ModuleInfoToDB($module_folder);
$extra_config = $module_dir . "/deploy/install.run";
if (fs_director::CheckFileExists($extra_config)) {
exec(ctrl_options::GetSystemOption('php_exer') . " " . $extra_config . "");
}
self::$ok = true;
}
} else {
self::$error_message = "Couldn't unzip the archive (" . $_FILES['modulefile']['tmp_name'] . ") to " . $module_dir . '/';
}
} else {
self::$error_message = "Couldn't create module folder in " . $module_dir;
}
}
} else {
self::$error_message = "The module " . $module_folder . " is already installed on this server!";
}
}
return;
}