コード例 #1
0
ファイル: local.php プロジェクト: knigherrant/decopatio
 /**
  * Retrieves the file / folder information
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function getItem($uri)
 {
     // Profiling
     $start = microtime(true);
     // Get the path based on the uri
     $path = EBMM::getPath($uri);
     // Determines if this is a directory
     $isFolder = @is_dir($path);
     // Determines if this is a file.
     $isFile = @is_file($path);
     // Some folders might not be created yet until they decide to upload it later
     if ((EBMM::isPostPlace($uri) || EBMM::isUserPlace($uri) || $uri == "shared") && !$isFile) {
         $isFolder = true;
     }
     $item = $isFolder ? $this->getFolderItem($uri) : $this->getFileItem($uri);
     // File stats
     $item->modified = @filemtime($path);
     $item->size = @filesize($path);
     // Variations
     if ($item->type == 'image') {
         $folderurl = dirname($item->url);
         $filename = basename($path);
         $item->thumbnail = $folderurl . '/' . EBLOG_SYSTEM_VARIATION_PREFIX . '_icon_' . $filename;
         $item->preview = $folderurl . '/' . EBLOG_SYSTEM_VARIATION_PREFIX . '_thumbnail_' . $filename;
         $item->variations = self::getVariations($uri);
     }
     $end = microtime(true);
     $scantime = ($end - $start) * 1000;
     $item->scantime = $scantime;
     return $item;
 }