- Timestamp:
- 2013/02/18 19:09:54 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_FileManager.php
r22206 r22567 29 29 * @version $Id$ 30 30 */ 31 class SC_Helper_FileManager { 31 class SC_Helper_FileManager 32 { 32 33 33 34 /** … … 37 38 * @return void 38 39 */ 39 function sfGetFileList($dir) { 40 function sfGetFileList($dir) 41 { 40 42 $arrFileList = array(); 41 43 $arrDirList = array(); … … 91 93 * @return void 92 94 */ 93 function sfGetDirSize($dir) { 95 function sfGetDirSize($dir) 96 { 94 97 $bytes = 0; 95 98 if (file_exists($dir)) { … … 129 132 * @return array ツリー生成用の配列 130 133 */ 131 function sfGetFileTree($dir, $tree_status) { 134 function sfGetFileTree($dir, $tree_status) 135 { 132 136 133 137 $cnt = 0; … … 170 174 * @return array ツリー生成用の配列 171 175 */ 172 function sfGetFileTreeSub($dir, $default_rank, &$cnt, &$arrTree, $tree_status) { 176 function sfGetFileTreeSub($dir, $default_rank, &$cnt, &$arrTree, $tree_status) 177 { 173 178 174 179 if (file_exists($dir)) { … … 217 222 * @return bool ファイルが存在する場合 true 218 223 */ 219 function sfDirChildExists($dir) { 224 function sfDirChildExists($dir) 225 { 220 226 if (file_exists($dir)) { 221 227 if (is_dir($dir)) { … … 243 249 * @return bool 前回開かれた状態の場合 true 244 250 */ 245 function lfIsFileOpen($dir, $tree_status) { 251 function lfIsFileOpen($dir, $tree_status) 252 { 246 253 $arrTreeStatus = explode('|', $tree_status); 247 254 if (in_array($dir, $arrTreeStatus)) { … … 258 265 * @return void 259 266 */ 260 function sfDownloadFile($file) { 267 function sfDownloadFile($file) 268 { 261 269 // ファイルの場合はダウンロードさせる 262 270 Header('Content-disposition: attachment; filename='.basename($file)); … … 274 282 * @return bool ファイル作成に成功した場合 true 275 283 */ 276 function sfCreateFile($file, $mode = '') { 284 function sfCreateFile($file, $mode = '') 285 { 277 286 // 行末の/を取り除く 278 287 if ($mode != '') { … … 291 300 * @return string ファイルの内容 292 301 */ 293 function sfReadFile($filename) { 302 function sfReadFile($filename) 303 { 294 304 $str = ''; 295 305 // バイナリモードでオープン … … 311 321 * @return boolean ファイルの書き込みに成功した場合 true 312 322 */ 313 function sfWriteFile($filename, $value) { 323 function sfWriteFile($filename, $value) 324 { 314 325 if (!is_dir(dirname($filename))) { 315 326 SC_Utils_Ex::recursiveMkdir(dirname($filename), 0777); … … 332 343 * @return boolean 成功した場合 true; 失敗した場合 false 333 344 */ 334 function downloadArchiveFiles($dir, $template_code) { 345 function downloadArchiveFiles($dir, $template_code) 346 { 335 347 // ダウンロードされるファイル名 336 348 $dlFileName = 'tpl_package_' . $template_code . '_' . date('YmdHis') . '.tar.gz'; … … 370 382 * @return boolean Archive_Tar::extractModify()のエラー 371 383 */ 372 function unpackFile($path) { 384 function unpackFile($path) 385 { 373 386 // 圧縮フラグTRUEはgzip解凍をおこなう 374 387 $tar = new Archive_Tar($path, true); … … 398 411 * @return void 399 412 */ 400 function deleteFile($path, $del_myself = true) { 413 function deleteFile($path, $del_myself = true) 414 { 401 415 $flg = false; 402 416 // 対象が存在するかを検証.
Note: See TracChangeset
for help on using the changeset viewer.