FileHandler 클래스 참조

contains methods for accessing file system 더 자세히 ...

FileHandler에 대한 상속 다이어그램 :
Inheritance graph
FileHandler에 대한 협력 다이어그램:
Collaboration graph

모든 멤버 목록

Public 멤버 함수

 getRealPath ($source)
 changes path of target file, directory into absolute path
 copyDir ($source_dir, $target_dir, $filter=null, $type=null)
 copy a directory to target
 copyFile ($source, $target, $force='Y')
 copy a file to target
 readFile ($file_name)
 returns the content of the file
 writeFile ($file_name, $buff, $mode="w")
 write $buff into the specified file
 removeFile ($file_name)
 remove a file
 rename ($source, $target)
 rename a file
 moveDir ($source_dir, $target_dir)
 move a directory
 readDir ($path, $filter= '', $to_lower=false, $concat_prefix=false)
 return list of the files in the path
 makeDir ($path_string)
 creates a directory
 removeDir ($path)
 remove all files under the path
 removeBlankDir ($path)
 remove a directory only if it is empty
 removeFilesInDir ($path)
 filesize ($size)
 makes file size byte into KB, MB according to the size
 getRemoteResource ($url, $body=null, $timeout=3, $method= 'GET', $content_type=null, $headers=array(), $cookies=array(), $post_data=array())
 return remote file's content via HTTP
 getRemoteFile ($url, $target_filename, $body=null, $timeout=3, $method= 'GET', $content_type=null, $headers=array())
 retrieves remote file, then stores it into target path.
 createImageFile ($source_file, $target_file, $resize_width=0, $resize_height=0, $target_type= '', $thumbnail_type= 'crop')
 moves an image file (resizing is possible)
 readIniFile ($filename)
 reads ini file, and puts result into array
 writeIniFile ($filename, $arr)
 write array into ini file
 _makeIniBuff ($arr)
 openFile ($file_name, $mode)
 return file object

상세한 설명

contains methods for accessing file system

작성자:
zero (zero@nzeo.com)

FileHandler.class.php 파일의 8 번째 라인에서 정의되었습니다.


멤버 함수 문서화

FileHandler::_makeIniBuff ( arr  ) 

FileHandler.class.php 파일의 576 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : writeIniFile().

00576                                    {
00577             $return = '';
00578             foreach($arr as $key => $val){
00579                 // section
00580                 if(is_array($val)){
00581                     $return .= sprintf("[%s]\n",$key);
00582                     foreach($val as $k => $v){
00583                         $return .= sprintf("%s=\"%s\"\n",$k,$v);
00584                     }
00585                 // value
00586                 }else if(is_string($val) || is_int($val)){
00587                     $return .= sprintf("%s=\"%s\"\n",$key,$val);
00588                 }
00589             }
00590             return $return;
00591         }

FileHandler::copyDir ( source_dir,
target_dir,
filter = null,
type = null 
)

copy a directory to target

매개변수:
[in] $source_dir path of source directory
[in] $target_dir path of target dir
[in] $filter 
[in] $type 
Remarks:
if target directory does not exist, this function creates it
반환값:
none

FileHandler.class.php 파일의 30 번째 라인에서 정의되었습니다.

다음을 참조함 : getRealPath(), makeDir().

00030                                                                            {
00031             $source_dir = FileHandler::getRealPath($source_dir);
00032             $target_dir = FileHandler::getRealPath($target_dir);
00033             if(!is_dir($source_dir)) return false;
00034 
00035             // target이 없을땐 생성
00036             if(!file_exists($target_dir)) FileHandler::makeDir($target_dir);
00037 
00038             if(substr($source_dir, -1) != '/') $source_dir .= '/';
00039             if(substr($target_dir, -1) != '/') $target_dir .= '/';
00040 
00041             $oDir = dir($source_dir);
00042             while($file = $oDir->read()) {
00043                 if(substr($file,0,1)=='.') continue;
00044                 if($filter && preg_match($filter, $file)) continue;
00045                 if(is_dir($source_dir.$file)){
00046                     FileHandler::copyDir($source_dir.$file,$target_dir.$file,$type);
00047                 }else{
00048                     if($type == 'force'){
00049                         @unlink($target_dir.$file);
00050                     }else{
00051                         if(!file_exists($target_dir.$file)) @copy($source_dir.$file,$target_dir.$file);
00052                     }
00053                 }
00054             }
00055         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::copyFile ( source,
target,
force = 'Y' 
)

copy a file to target

매개변수:
[in] $source path of source file
[in] $target path of target file
[in] $force Y: overwrite
반환값:
none

FileHandler.class.php 파일의 64 번째 라인에서 정의되었습니다.

다음을 참조함 : getRealPath(), makeDir().

다음에 의해서 참조됨 : layoutModel::getUserLayoutHtml(), layoutModel::getUserLayoutIni(), layoutModel::getUserLayoutIniConfig(), Context::loadLangSelected(), layout::moduleUpdate().

00064                                                        {
00065             $source = FileHandler::getRealPath($source);
00066             $target_dir = FileHandler::getRealPath(dirname($target));
00067             $target = basename($target);
00068             if(!file_exists($target_dir)) FileHandler::makeDir($target_dir);
00069             if($force=='Y') @unlink($target_dir.'/'.$target);
00070             @copy($source, $target_dir.'/'.$target);
00071         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::createImageFile ( source_file,
target_file,
resize_width = 0,
resize_height = 0,
target_type = '',
thumbnail_type = 'crop' 
)

moves an image file (resizing is possible)

매개변수:
[in] $source_file path of the source file
[in] $target_file path of the target file
[in] $resize_width width to resize
[in] $resize_height height to resize
[in] $target_type if $target_type is set (gif, jpg, png, bmp), result image will be saved as target type
[in] $thumbnail_type thumbnail type(crop, ratio)
반환값:
true: success, false: failed

FileHandler.class.php 파일의 410 번째 라인에서 정의되었습니다.

다음을 참조함 : $output, getRealPath(), makeDir().

다음에 의해서 참조됨 : integration_searchModel::_getFiles(), documentItem::getThumbnail(), commentItem::getThumbnail(), memberController::insertImageMark(), memberController::insertImageName(), memberController::insertProfileImage(), fileController::procFileImageResize().

00410                                                                                                                                                  {
00411             $source_file = FileHandler::getRealPath($source_file);
00412             $target_file = FileHandler::getRealPath($target_file);
00413 
00414             if(!file_exists($source_file)) return;
00415             if(!$resize_width) $resize_width = 100;
00416             if(!$resize_height) $resize_height = $resize_width;
00417 
00418             // retrieve source image's information
00419             list($width, $height, $type, $attrs) = @getimagesize($source_file);
00420             if($width<1 || $height<1) return;
00421 
00422             switch($type) {
00423                 case '1' :
00424                         $type = 'gif';
00425                     break;
00426                 case '2' :
00427                         $type = 'jpg';
00428                     break;
00429                 case '3' :
00430                         $type = 'png';
00431                     break;
00432                 case '6' :
00433                         $type = 'bmp';
00434                     break;
00435                 default :
00436                         return;
00437                     break;
00438             }
00439 
00440             // if original image is larger than specified size to resize, calculate the ratio 
00441             if($resize_width > 0 && $width >= $resize_width) $width_per = $resize_width / $width;
00442             else $width_per = 1;
00443 
00444             if($resize_height>0 && $height >= $resize_height) $height_per = $resize_height / $height;
00445             else $height_per = 1;
00446 
00447             if($thumbnail_type == 'ratio') {
00448                 if($width_per>$height_per) $per = $height_per;
00449                 else $per = $width_per;
00450                 $resize_width = $width * $per;
00451                 $resize_height = $height * $per;
00452             } else {
00453                 if($width_per < $height_per) $per = $height_per;
00454                 else $per = $width_per;
00455             }
00456 
00457             if(!$per) $per = 1;
00458 
00459             // get type of target file
00460             if(!$target_type) $target_type = $type;
00461             $target_type = strtolower($target_type);
00462 
00463             // create temporary image with target size
00464             if(function_exists('imagecreatetruecolor')) $thumb = @imagecreatetruecolor($resize_width, $resize_height);
00465             else $thumb = @imagecreate($resize_width, $resize_height);
00466 
00467             $white = @imagecolorallocate($thumb, 255,255,255);
00468             @imagefilledrectangle($thumb,0,0,$resize_width-1,$resize_height-1,$white);
00469 
00470             // create temporary image having original type
00471             switch($type) {
00472                 case 'gif' :
00473                         if(!function_exists('imagecreatefromgif')) return false;
00474                         $source = @imagecreatefromgif($source_file);
00475                     break;
00476                 // jpg
00477                 case 'jpeg' :
00478                 case 'jpg' :
00479                         if(!function_exists('imagecreatefromjpeg')) return false;
00480                         $source = @imagecreatefromjpeg($source_file);
00481                     break;
00482                 // png
00483                 case 'png' :
00484                         if(!function_exists('imagecreatefrompng')) return false;
00485                         $source = @imagecreatefrompng($source_file);
00486                     break;
00487                 // bmp
00488                 case 'wbmp' :
00489                 case 'bmp' :
00490                         if(!function_exists('imagecreatefromwbmp')) return false;
00491                         $source = @imagecreatefromwbmp($source_file);
00492                     break;
00493                 default :
00494                     return;
00495             }
00496 
00497             // resize original image and put it into temporary image
00498             $new_width = (int)($width * $per);
00499             $new_height = (int)($height * $per);
00500 
00501             if($thumbnail_type == 'crop') {
00502                 $x = (int)($resize_width/2 - $new_width/2);
00503                 $y = (int)($resize_height/2 - $new_height/2);
00504             } else {
00505                 $x = 0;
00506                 $y = 0;
00507             }
00508 
00509             if($source) {
00510                 if(function_exists('imagecopyresampled')) @imagecopyresampled($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height);
00511                 else @imagecopyresized($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height);
00512             } else return false;
00513 
00514             // create directory 
00515             $path = dirname($target_file);
00516             if(!is_dir($path)) FileHandler::makeDir($path);
00517 
00518             // write into the file
00519             switch($target_type) {
00520                 case 'gif' :
00521                         if(!function_exists('imagegif')) return false;
00522                         $output = @imagegif($thumb, $target_file);
00523                     break;
00524                 case 'jpeg' :
00525                 case 'jpg' :
00526                         if(!function_exists('imagejpeg')) return false;
00527                         $output = @imagejpeg($thumb, $target_file, 100);
00528                     break;
00529                 case 'png' :
00530                         if(!function_exists('imagepng')) return false;
00531                         $output = @imagepng($thumb, $target_file, 9);
00532                     break;
00533                 case 'wbmp' :
00534                 case 'bmp' :
00535                         if(!function_exists('imagewbmp')) return false;
00536                         $output = @imagewbmp($thumb, $target_file, 100);
00537                     break;
00538             }
00539 
00540             @imagedestroy($thumb);
00541             @imagedestroy($source);
00542 
00543             if(!$output) return false;
00544             @chmod($target_file, 0644);
00545 
00546             return true;
00547         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::filesize ( size  ) 

makes file size byte into KB, MB according to the size

매개변수:
[in] $size number of the size
반환값:
file size string

FileHandler.class.php 파일의 306 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : debugPrint(), fileModel::getFileList(), fileModel::getUploadStatus(), readFile().

00306                                  {
00307             if(!$size) return "0Byte";
00308             if($size < 1024) return ($size."Byte");
00309             if($size >= 1024 && $size < 1024*1024) return sprintf("%0.1fKB",$size / 1024);
00310             return sprintf("%0.2fMB",$size / (1024*1024));
00311         }

FileHandler::getRealPath ( source  ) 

changes path of target file, directory into absolute path

매개변수:
[in] $source path
반환값:
absolute path

FileHandler.class.php 파일의 15 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : TemplateHandler::_compile(), TemplateHandler::compile(), copyDir(), copyFile(), createImageFile(), getRemoteFile(), layoutModel::getUserLayoutHtml(), layoutModel::getUserLayoutIni(), layoutModel::getUserLayoutIniConfig(), layoutAdminController::importLayout(), layoutAdminController::procLayoutAdminUserLayoutExport(), layoutAdminController::procLayoutAdminUserLayoutImport(), readDir(), readFile(), readIniFile(), removeBlankDir(), removeDir(), removeFile(), removeFilesInDir(), rename(), writeFile().

00015                                       {
00016             $temp = explode('/', $source);
00017             if($temp[0] == '.') $source = _XE_PATH_.substr($source, 2);
00018             return $source;
00019         }

FileHandler::getRemoteFile ( url,
target_filename,
body = null,
timeout = 3,
method = 'GET',
content_type = null,
headers = array() 
)

retrieves remote file, then stores it into target path.

매개변수:
[in] $url the address of the target file
[in] $target_file the location to store
[in] $body HTTP request body
[in] $timeout connection timeout
[in] $method GET/POST
[in] $content_type content type header of HTTP request
[in] $headers headers key vaule array.
반환값:
true: success, false: failed

FileHandler.class.php 파일의 392 번째 라인에서 정의되었습니다.

다음을 참조함 : getRealPath(), getRemoteResource(), writeFile().

다음에 의해서 참조됨 : adminAdminView::dispAdminIndex(), opageView::getHtmlPage(), documentItem::getThumbnail(), commentItem::getThumbnail(), importerAdminController::importAttaches().

00392                                                                                                                                               {
00393             $body = FileHandler::getRemoteResource($url, $body, $timeout, $method, $content_type, $headers);
00394             if(!$body) return false;
00395             $target_filename = FileHandler::getRealPath($target_filename);
00396             FileHandler::writeFile($target_filename, $body);
00397             return true;
00398         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::getRemoteResource ( url,
body = null,
timeout = 3,
method = 'GET',
content_type = null,
headers = array(),
cookies = array(),
post_data = array() 
)

return remote file's content via HTTP

매개변수:
[in] $url the address of the target file
[in] $body HTTP request body
[in] $timeout connection timeout
[in] $method GET/POST
[in] $content_type content type header of HTTP request
[in] $headers headers key vaule array.
[in] $cookies cookies key value array.
[in] $post_data request arguments array for POST method
반환값:
if success, the content of the target file. otherwise: none
Remarks:
if the target is moved (when return code is 300~399), this function follows the location specified response header.

FileHandler.class.php 파일의 326 번째 라인에서 정의되었습니다.

다음을 참조함 : null.

다음에 의해서 참조됨 : getRemoteFile(), content::requestFeedContents().

00326                                                                                                                                                                           {
00327             set_include_path(_XE_PATH_."libs/PEAR");
00328             require_once('PEAR.php');
00329             require_once('HTTP/Request.php');
00330 
00331             if(__PROXY_SERVER__!==null) {
00332                 $oRequest = new HTTP_Request(__PROXY_SERVER__);
00333                 $oRequest->setMethod('POST');
00334                 $oRequest->_timeout = $timeout;
00335                 $oRequest->addPostData('arg', serialize(array('Destination'=>$url, 'method'=>$method, 'body'=>$body, 'content_type'=>$content_type, "headers"=>$headers, "post_data"=>$post_data)));
00336             } else {
00337                 $oRequest = new HTTP_Request($url);
00338                 if(count($headers)) {
00339                     foreach($headers as $key => $val) {
00340                         $oRequest->addHeader($key, $val);
00341                     }
00342                 }
00343                 if($cookies[$host]) {
00344                     foreach($cookies[$host] as $key => $val) {
00345                         $oRequest->addCookie($key, $val);
00346                     }
00347                 }
00348                 if(count($post_data)) {
00349                     foreach($post_data as $key => $val) {
00350                         $oRequest->addPostData($key, $val);
00351                     }
00352                 }
00353                 if(!$content_type) $oRequest->addHeader('Content-Type', 'text/html');
00354                 else $oRequest->addHeader('Content-Type', $content_type);
00355                 $oRequest->setMethod($method);
00356                 if($body) $oRequest->setBody($body);
00357 
00358                 $oRequest->_timeout = $timeout;
00359             }
00360 
00361             $oResponse = $oRequest->sendRequest();
00362 
00363             $code = $oRequest->getResponseCode();
00364             $header = $oRequest->getResponseHeader();
00365             $response = $oRequest->getResponseBody();
00366             if($c = $oRequest->getResponseCookies()) {
00367                 foreach($c as $k => $v) {
00368                     $cookies[$host][$v['name']] = $v['value'];
00369                 }
00370             }
00371 
00372             if($code > 300 && $code < 399 && $header['location']) {
00373                 return FileHandler::getRemoteResource($header['location'], $body, $timeout, $method, $content_type, $headers, $cookies, $post_data);
00374             } 
00375 
00376             if($code != 200) return;
00377 
00378             return $response;
00379         }

FileHandler::makeDir ( path_string  ) 

creates a directory

매개변수:
[in] $path_string path of target directory
반환값:
true if success. it might return nothing when ftp is used and connection to the ftp address failed.
Remarks:
This function creates directories recursively, which means that if ancestors of the target directory does not exist, they will be created too.

FileHandler.class.php 파일의 198 번째 라인에서 정의되었습니다.

다음을 참조함 : Context::getFTPInfo(), Context::isFTPRegisted(), null.

다음에 의해서 참조됨 : HTTPRetriever::_cache_store(), integration_searchModel::_getFiles(), opage::checkUpdate(), copyDir(), copyFile(), createImageFile(), widgetController::getCache(), editorModel::getCacheFile(), addonController::getCacheFilePath(), DB::getCountCache(), pointModel::getPoint(), documentItem::getThumbnail(), commentItem::getThumbnail(), ttimport::getTmpFilename(), importerAdminController::getTmpFilename(), ttimport::importAttaches(), importerAdminController::importAttaches(), layoutAdminController::importLayout(), importerAdminController::importMember(), fileController::insertFile(), memberController::insertImageMark(), memberController::insertImageName(), moduleController::insertModuleFileBox(), memberController::insertProfileImage(), layoutAdminController::insertUserLayoutImage(), moduleAdminController::makeCacheDefinedLangCode(), addonController::makeCacheFile(), installController::makeDefaultDirectory(), widget::moduleInstall(), point::moduleInstall(), page::moduleInstall(), opage::moduleInstall(), module::moduleInstall(), menu::moduleInstall(), member::moduleInstall(), layout::moduleInstall(), file::moduleInstall(), editor::moduleInstall(), communication::moduleInstall(), member::moduleUpdate(), layout::moduleUpdate(), communication::moduleUpdate(), fileController::moveFile(), openFile(), Optimizer::Optimizer(), menuAdminController::procMenuAdminUploadButton(), rssAdminController::procRssAdminInsertConfig(), DB::putCountCache(), memberController::putSignature(), layout::recompileCache(), DB::resetCountCache(), communicationController::sendMessage(), extract::set(), moduleController::updateModuleFileBox(), writeFile().

00198                                        {
00199             static $oFtp = null;
00200 
00201             // if safe_mode is on, use FTP 
00202             if(ini_get('safe_mode') && $oFtp == null) {
00203                 if(!Context::isFTPRegisted()) return;
00204 
00205                 require_once(_XE_PATH_.'libs/ftp.class.php');
00206                 $ftp_info = Context::getFTPInfo();
00207                 $oFtp = new ftp();
00208                 if(!$oFtp->ftp_connect('localhost')) return;
00209                 if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) {
00210                     $oFtp->ftp_quit();
00211                     return;
00212                 }
00213             }
00214 
00215             $path_string = str_replace(_XE_PATH_,'',$path_string);
00216             $path_list = explode('/', $path_string);
00217 
00218             $path = _XE_PATH_;
00219             for($i=0;$i<count($path_list);$i++) {
00220                 if(!$path_list[$i]) continue;
00221                 $path .= $path_list[$i].'/';
00222                 if(!is_dir($path)) {
00223                     if(ini_get('safe_mode')) {
00224                         $oFtp->ftp_mkdir($path);
00225                         $oFtp->ftp_site("CHMOD 777 ".$path);
00226                     } else {
00227                         @mkdir($path, 0755);
00228                         @chmod($path, 0755);
00229                     }
00230                 }
00231             }
00232 
00233             return is_dir($path_string);
00234         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::moveDir ( source_dir,
target_dir 
)

move a directory

매개변수:
[in] $source_dir path of source directory
[in] $target_dir path of target directory
Remarks:
this function just wraps rename function.
반환값:
none

FileHandler.class.php 파일의 151 번째 라인에서 정의되었습니다.

다음을 참조함 : rename().

00151                                                    {
00152             FileHandler::rename($source_dir, $target_dir);
00153         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::openFile ( file_name,
mode 
)

return file object

매개변수:
[in] $file_name target file name
[in] $mode file mode for fopen
Remarks:
if the directory of the file does not exist, create it.
반환값:
file object

FileHandler.class.php 파일의 600 번째 라인에서 정의되었습니다.

다음을 참조함 : makeDir().

다음에 의해서 참조됨 : Optimizer::makeOptimizedFile().

00601         {
00602             $pathinfo = pathinfo($file_name);
00603             $path = $pathinfo['dirname'];
00604             if(!is_dir($path)) FileHandler::makeDir($path);
00605 
00606             require_once("FileObject.class.php");
00607             $file_object = new FileObject($file_name, $mode);
00608             return $file_object;
00609         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::readDir ( path,
filter = '',
to_lower = false,
concat_prefix = false 
)

return list of the files in the path

매개변수:
[in] $path path of target directory
[in] $filter if specified, return only files matching with the filter
[in] $to_lower if true, file names will be changed into lower case.
[in] $concat_prefix if true, return file name as absolute path
Remarks:
the array does not contain files, such as '.', '..', and files starting with '.'
반환값:
array of the filenames in the path

FileHandler.class.php 파일의 164 번째 라인에서 정의되었습니다.

다음을 참조함 : $output, getRealPath().

다음에 의해서 참조됨 : layout::checkUpdate(), menuAdminController::deleteMenu(), pointAdminView::dispPointAdminConfig(), addonAdminModel::getAddonList(), layoutModel::getDownloadedLayoutList(), widgetModel::getDownloadedWidgetList(), widgetModel::getDownloadedWidgetStyleList(), editorModel::getEditorSkinList(), moduleModel::getModuleList(), moduleModel::getModulesXmlInfo(), emoticon::getPopupContent(), moduleModel::getSkins(), layoutModel::getUserLayoutFileList(), layoutModel::getUserLayoutImageList(), installController::installDownloadedModule(), installController::installModule(), moduleModel::isIDExists(), editorController::makeCache(), layout::moduleUpdate(), XmlQueryParser::parse(), editorView::triggerDispEditorAdditionSetup().

00164                                                                                          {
00165             $path = FileHandler::getRealPath($path);
00166 
00167             if(substr($path,-1)!='/') $path .= '/';
00168             if(!is_dir($path)) return array();
00169 
00170             $oDir = dir($path);
00171             while($file = $oDir->read()) {
00172                 if(substr($file,0,1)=='.') continue;
00173 
00174                 if($filter && !preg_match($filter, $file)) continue;
00175 
00176                 if($to_lower) $file = strtolower($file);
00177 
00178                 if($filter) $file = preg_replace($filter, '$1', $file);
00179                 else $file = $file;
00180 
00181                 if($concat_prefix) {
00182                     $file = sprintf('%s%s', str_replace(_XE_PATH_, '', $path), $file);
00183                 }
00184 
00185                 $output[] = $file;
00186             }
00187             if(!$output) return array();
00188 
00189             return $output;
00190         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::readFile ( file_name  ) 

returns the content of the file

매개변수:
[in] $file_name path of target file
반환값:
the content of the file. if target file does not exist, this function returns nothing.

FileHandler.class.php 파일의 78 번째 라인에서 정의되었습니다.

다음을 참조함 : filesize(), getRealPath().

다음에 의해서 참조됨 : XmlJsFilter::_compile(), TemplateHandler::_compileTplFile(), DBSqlite3_pdo::createTableByXmlFile(), DBSqlite2::createTableByXmlFile(), DBPostgresql::createTableByXmlFile(), DBMysql_innodb::createTableByXmlFile(), DBMysql::createTableByXmlFile(), DBMssql::createTableByXmlFile(), DBFireBird::createTableByXmlFile(), DBCubrid::createTableByXmlFile(), adminAdminView::dispAdminIndex(), mobileXE::displayLangSelect(), layoutAdminView::dispLayoutAdminEdit(), layoutAdminView::dispLayoutAdminLayoutModify(), pageView::dispPageIndex(), widgetController::getCache(), DB::getCountCache(), opageView::getHtmlPage(), mobileXE::getInstance(), memberModel::getMemberConfig(), pointModel::getPoint(), memberModel::getSignature(), importerAdminController::importModule(), Context::loadLangSelected(), XmlParser::loadXmlFile(), Optimizer::makeOptimizedFile(), extract::mergeItems(), XmlQueryParser::parse(), layoutAdminController::procLayoutAdminUserValueInsert(), communicationController::sendMessage(), mobileXE::setLangType().

00078                                       {
00079             $file_name = FileHandler::getRealPath($file_name);
00080 
00081             if(!file_exists($file_name)) return;
00082             $filesize = filesize($file_name);
00083             if($filesize<1) return;
00084 
00085             if(function_exists('file_get_contents')) return file_get_contents($file_name);
00086 
00087             $fp = fopen($file_name, "r");
00088             $buff = '';
00089             if($fp) {
00090                 while(!feof($fp) && strlen($buff)<=$filesize) {
00091                     $str = fgets($fp, 1024);
00092                     $buff .= $str;
00093                 }
00094                 fclose($fp);
00095             }
00096             return $buff;
00097         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::readIniFile ( filename  ) 

reads ini file, and puts result into array

매개변수:
[in] $filename path of the ini file
반환값:
ini array (if the target file does not exist, it returns false)

FileHandler.class.php 파일의 555 번째 라인에서 정의되었습니다.

다음을 참조함 : getRealPath().

다음에 의해서 참조됨 : layoutModel::getUserLayoutIniConfig().

00555                                        {
00556             $filename = FileHandler::getRealPath($filename);
00557             if(!file_exists($filename)) return false;
00558             $arr = parse_ini_file($filename, true);
00559             if(is_array($arr) && count($arr)>0) return $arr;
00560             else return array();
00561         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::removeBlankDir ( path  ) 

remove a directory only if it is empty

매개변수:
[in] $path path of the target directory
반환값:
none

FileHandler.class.php 파일의 263 번째 라인에서 정의되었습니다.

다음을 참조함 : getRealPath().

다음에 의해서 참조됨 : fileController::deleteFiles(), fileAdminController::deleteModuleFiles().

00263                                        {
00264             $item_cnt = 0;
00265 
00266             $path = FileHandler::getRealPath($path);
00267             if(!is_dir($path)) return;
00268             $directory = dir($path);
00269             while($entry = $directory->read()) {
00270                 if ($entry == "." || $entry == "..") continue;
00271                 if (is_dir($path."/".$entry)) $item_cnt = FileHandler::removeBlankDir($path.'/'.$entry);
00272             }
00273             $directory->close();
00274 
00275             if($item_cnt < 1) @rmdir($path);
00276         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::removeDir ( path  ) 

remove all files under the path

매개변수:
[in] $path path of the target directory
반환값:
none

FileHandler.class.php 파일의 241 번째 라인에서 정의되었습니다.

다음을 참조함 : getRealPath().

다음에 의해서 참조됨 : documentController::deleteDocument(), layoutAdminController::deleteLayout(), menuAdminController::deleteMenu(), fileAdminController::deleteModuleFiles(), layoutAdminController::initLayout(), pointAdminController::procPointAdminApplyPoint(), session::recompileCache(), module::recompileCache().

00241                                   {
00242             $path = FileHandler::getRealPath($path);
00243             if(!is_dir($path)) return;
00244             $directory = dir($path);
00245             while($entry = $directory->read()) {
00246                 if ($entry != "." && $entry != "..") {
00247                     if (is_dir($path."/".$entry)) {
00248                         FileHandler::removeDir($path."/".$entry);
00249                     } else {
00250                         @unlink($path."/".$entry);
00251                     }
00252                 }
00253             }
00254             $directory->close();
00255             @rmdir($path);
00256         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::removeFile ( file_name  ) 

remove a file

매개변수:
[in] $file_name path of target file
반환값:
none

FileHandler.class.php 파일의 126 번째 라인에서 정의되었습니다.

다음을 참조함 : getRealPath().

다음에 의해서 참조됨 : HTTPRetriever::_cache_fetch(), addon::checkUpdate(), fileController::deleteFile(), fileController::deleteFiles(), layoutAdminController::deleteLayout(), menuAdminController::deleteMenu(), moduleController::deleteModuleFileBox(), fileAdminController::deleteModuleFiles(), documentAdminController::deleteThumbnailFile(), layoutAdminController::deleteUserLayoutTempFile(), memberController::delSignature(), communicationView::dispCommunicationNewMessage(), pageView::dispPageIndex(), opageView::executeFile(), commentModel::fixCommentList(), widgetController::getCache(), editorModel::getComponentList(), documentItem::getThumbnail(), commentItem::getThumbnail(), layoutAdminController::importLayout(), importerAdminController::importMember(), importerAdminController::importMessage(), ttimport::importModule(), importerAdminController::importModule(), Context::loadLangSelected(), extract::mergeItems(), extract::openFile(), adminAdminController::procAdminRecompileCacheFile(), layoutAdminController::procLayoutAdminCodeReset(), memberController::procMemberDeleteImageMark(), memberController::procMemberDeleteImageName(), memberController::procMemberDeleteProfileImage(), menuAdminController::procMenuAdminDeleteButton(), menuAdminController::procMenuAdminDeleteItem(), moduleAdminController::procModuleAdminUpdateSkinInfo(), opageAdminController::procOpageAdminInsert(), pageAdminController::procPageAdminRemoveWidgetCache(), pointAdminController::procPointAdminApplyPoint(), rssAdminController::procRssAdminInsertConfig(), memberController::putSignature(), layout::recompileCache(), admin::recompileCache(), addonController::removeAddonConfig(), editorController::removeCache(), DB::resetCountCache(), mobileXE::setLangType(), layoutAdminController::updateLayout(), moduleController::updateModuleFileBox().

00126                                         {
00127             $file_name = FileHandler::getRealPath($file_name);
00128             if(file_exists($file_name)) @unlink($file_name);
00129         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::removeFilesInDir ( path  ) 

remove files in the target directory.

매개변수:
[in] $path path of the target directory
Remarks:
This function keeps the directory structure.
반환값:
none

FileHandler.class.php 파일의 285 번째 라인에서 정의되었습니다.

다음을 참조함 : getRealPath().

다음에 의해서 참조됨 : moduleController::deleteTrigger(), Optimizer::doOptimizedFile(), moduleController::insertTrigger(), documentAdminController::procDocumentAdminDeleteAllThumbnail(), importerAdminController::procImporterAdminImport(), widget::recompileCache(), page::recompileCache(), opage::recompileCache(), module::recompileCache(), menu::recompileCache(), editor::recompileCache(), document::recompileCache(), admin::recompileCache(), addon::recompileCache().

00285                                          {
00286             $path = FileHandler::getRealPath($path);
00287             if(!is_dir($path)) return;
00288             $directory = dir($path);
00289             while($entry = $directory->read()) {
00290                 if ($entry != "." && $entry != "..") {
00291                     if (is_dir($path."/".$entry)) {
00292                         FileHandler::removeFilesInDir($path."/".$entry);
00293                     } else {
00294                         @unlink($path."/".$entry);
00295                     }
00296                 }
00297             }
00298             $directory->close();
00299         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::rename ( source,
target 
)

rename a file

매개변수:
[in] $source path of source file
[in] $target path of target file
Remarks:
In order to move a file, use this function.
반환값:
none

FileHandler.class.php 파일의 138 번째 라인에서 정의되었습니다.

다음을 참조함 : getRealPath().

다음에 의해서 참조됨 : ttimport::importAttaches(), importerAdminController::importAttaches(), moveDir(), fileController::moveFile(), pointAdminController::procPointAdminApplyPoint().

00138                                           {
00139             $source = FileHandler::getRealPath($source);
00140             $target = FileHandler::getRealPath($target);
00141             @rename($source, $target);
00142         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::writeFile ( file_name,
buff,
mode = "w" 
)

write $buff into the specified file

매개변수:
[in] $file_name path of target file
[in] $buff content to be writeen
[in] $mode a(append) / w(write)
반환값:
none

FileHandler.class.php 파일의 106 번째 라인에서 정의되었습니다.

다음을 참조함 : getRealPath(), makeDir().

다음에 의해서 참조됨 : TemplateHandler::_compileTplFile(), adminAdminView::dispAdminIndex(), pageView::dispPageIndex(), opageView::executeFile(), commentModel::fixCommentList(), widgetController::getCache(), pointModel::getPoint(), getRemoteFile(), documentItem::getThumbnail(), commentItem::getThumbnail(), widgetModel::getWidgetInfo(), widgetModel::getWidgetStyleInfo(), layoutAdminController::importLayout(), importerAdminController::importMember(), Context::loadLangSelected(), addonController::makeCacheFile(), installController::makeConfigFile(), Optimizer::makeOptimizedFile(), menuAdminController::makeXmlFile(), importerAdminController::procImporterAdminPreProcessing(), installAdminController::procInstallAdminSaveLangSelected(), layoutAdminController::procLayoutAdminCodeUpdate(), layoutAdminController::procLayoutAdminUserValueInsert(), DB::putCountCache(), memberController::putSignature(), DB::resetCountCache(), communicationController::sendMessage(), mobileXE::setLangType(), memberController::setMemberConfig(), pointController::setPoint(), writeIniFile().

00106                                                            {
00107             $file_name = FileHandler::getRealPath($file_name);
00108 
00109             $pathinfo = pathinfo($file_name);
00110             $path = $pathinfo['dirname'];
00111             if(!is_dir($path)) FileHandler::makeDir($path);
00112 
00113             $mode = strtolower($mode);
00114             if($mode != "a") $mode = "w";
00115             if(@!$fp = fopen($file_name,$mode)) return false;
00116             fwrite($fp, $buff);
00117             fclose($fp);
00118             @chmod($file_name, 0644);
00119         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

FileHandler::writeIniFile ( filename,
arr 
)

write array into ini file

매개변수:
[in] $filename target ini file name
[in] $arr array
반환값:
if array contains nothing it returns false, otherwise true

FileHandler.class.php 파일의 570 번째 라인에서 정의되었습니다.

다음을 참조함 : _makeIniBuff(), writeFile().

다음에 의해서 참조됨 : layoutAdminController::insertUserLayoutValue().

00570                                               {
00571             if(count($arr)==0) return false;
00572             FileHandler::writeFile($filename, FileHandler::_makeIniBuff($arr));
00573             return true;
00574         }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.:

생성시간 : Wed Oct 28 23:00:09 2009, 프로젝트명 : XpressEngine, 생성자 :   doxygen 1.6.1