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