diff --git a/classes/file/FileHandler.class.php b/classes/file/FileHandler.class.php index b56a1cd99..a1bdb9695 100644 --- a/classes/file/FileHandler.class.php +++ b/classes/file/FileHandler.class.php @@ -185,72 +185,8 @@ class FileHandler */ public static function makeDir($path_string) { - if (!ini_get('safe_mode')) - { - $path = self::getRealPath($path_string); - return Rhymix\Framework\Storage::isDirectory($path) || Rhymix\Framework\Storage::createDirectory($path); - } - - // if safe_mode is on, use FTP - else - { - static $oFtp = NULL; - - $ftp_info = Context::getFTPInfo(); - if($oFtp == NULL) - { - if(!Context::isFTPRegisted()) - { - return; - } - - $oFtp = new ftp(); - if(!$ftp_info->ftp_host) - { - $ftp_info->ftp_host = "127.0.0.1"; - } - if(!$ftp_info->ftp_port) - { - $ftp_info->ftp_port = 21; - } - if(!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) - { - return; - } - if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) - { - $oFtp->ftp_quit(); - return; - } - } - - if(!($ftp_path = $ftp_info->ftp_root_path)) - { - $ftp_path = DIRECTORY_SEPARATOR; - } - - $path_string = str_replace(_XE_PATH_, '', $path_string); - $path_list = explode(DIRECTORY_SEPARATOR, $path_string); - - $path = _XE_PATH_; - for($i = 0, $c = count($path_list); $i < $c; $i++) - { - if(!$path_list[$i]) - { - continue; - } - - $path .= $path_list[$i] . DIRECTORY_SEPARATOR; - $ftp_path .= $path_list[$i] . DIRECTORY_SEPARATOR; - if(!is_dir($path)) - { - $oFtp->ftp_mkdir($ftp_path); - $oFtp->ftp_site("CHMOD 777 " . $ftp_path); - } - } - } - - return is_dir($path_string); + $path = self::getRealPath($path_string); + return Rhymix\Framework\Storage::isDirectory($path) || Rhymix\Framework\Storage::createDirectory($path); } /**