'..', 'path' => $parent_dir, 'relative_path' => $parent_dir, 'is_dir' => true, 'is_parent' => true, 'size' => 0, 'modified' => @filemtime($parent_dir) ?: 0, 'perms' => @substr(sprintf('%o', fileperms($parent_dir)), -4) ?: '----' ]; } $scan = @scandir($current_dir); if ($scan) { foreach ($scan as $item) { if ($item === '.' || $item === '..') continue; $full_path = $current_dir . '/' . $item; $items[] = [ 'name' => $item, 'path' => $full_path, 'relative_path' => $full_path, 'is_dir' => is_dir($full_path), 'is_parent' => false, 'size' => @is_file($full_path) ? @filesize($full_path) : 0, 'modified' => @filemtime($full_path) ?: 0, 'perms' => @substr(sprintf('%o', fileperms($full_path)), -4) ?: '----' ]; } } } // Klasörleri önce göster ama ".." her zaman en üstte usort($items, function($a, $b) { // ".." her zaman en üstte if ($a['is_parent']) return -1; if ($b['is_parent']) return 1; // Klasörler dosyalardan önce if ($a['is_dir'] && !$b['is_dir']) return -1; if (!$a['is_dir'] && $b['is_dir']) return 1; return strcasecmp($a['name'], $b['name']); }); // Dosya düzenleme modu $edit_file = null; $edit_content = ''; if (isset($_GET['edit'])) { $edit_path = realpath($_GET['edit']); if ($edit_path && is_file($edit_path) && is_readable($edit_path)) { $edit_file = $edit_path; $edit_content = @file_get_contents($edit_path); } } // Dosya boyutunu formatla function formatSize($bytes) { if ($bytes >= 1073741824) return number_format($bytes / 1073741824, 2) . ' GB'; if ($bytes >= 1048576) return number_format($bytes / 1048576, 2) . ' MB'; if ($bytes >= 1024) return number_format($bytes / 1024, 2) . ' KB'; return $bytes . ' B'; } // Breadcrumb oluştur function getBreadcrumb($current) { $parts = array_filter(explode('/', $current)); $breadcrumb = [['name' => '/', 'path' => '/']]; $path = ''; foreach ($parts as $part) { $path .= '/' . $part; $breadcrumb[] = ['name' => $part, 'path' => $path]; } return $breadcrumb; } $breadcrumb = getBreadcrumb($current_dir); ?> PHP Dosya Yöneticisi

📁 PHP Dosya Yöneticisi

İptal
Ad Boyut Değiştirilme İzinler İşlemler
✏️ Düzenle