Commits

christiansalazar committed cbd580b

now base class offers get_file_info instead of get_file_path

Comments (0)

Files changed (3)

IYiiFileManager.php

 	public function list_files($id, $extra=array());
 	public function remove_files($id, $file_id, $extra=array());
 	public function get_file_path($id, $file_id, $extra=array());
+	public function get_file_info($id, $file_id, $extra=array());
 
 	function on_file($id, $file_id, $file_path, $extra=array());
 	function get_file_list($id, $extra=array());

YiiBaseFileManager.php

 		return $removed_count;
 	}
 
-	public function get_file_path($id, $file_id, $extra=array()) {
+	public function get_file_info($id, $file_id, $extra=array()) {
 		foreach($this->list_files($id, $extra) as $existing)
 			if($existing['file_id']==$file_id)
-				return $existing['longfilename'];
+				return $existing;
 		return null;
 	}
 

YiiDiskFileManager.php

 		unlink($real_path);
 		return true;	
 	}
-
 	
 	public function get_file_path($id, $file_id, $extra=array()) {
-		$filename = parent::get_file_path($id, $file_id, $extra);
-		if($filename != null)
-			return sprintf("%s/%s",$this->get_storage_path($id),$filename);
+		$info = parent::get_file_info($id, $file_id, $extra);
+		if($info != null)
+			return sprintf("%s/%s",$this->get_storage_path($id),
+				$info['longfilename']);
 		return null;
 	}