From ce36c1be18ce924515399c561f19aef4f0325b49 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Fri, 20 Feb 2015 16:58:09 -0500 Subject: [PATCH 1/2] Removed unnecessary call to BaseCcFiles->delete --- airtime_mvc/application/models/airtime/CcFiles.php | 1 - 1 file changed, 1 deletion(-) diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php index 8463e2542..e27bed4a9 100644 --- a/airtime_mvc/application/models/airtime/CcFiles.php +++ b/airtime_mvc/application/models/airtime/CcFiles.php @@ -282,7 +282,6 @@ class CcFiles extends BaseCcFiles { if ($storedFile->existsOnDisk()) { $storedFile->delete(); //TODO: This checks your session permissions... Make it work without a session? } - $file->delete(); } else { throw new FileNotFoundException(); } From 909cbae5f4b1a95339b76f7d64d7dd0a8ea86304 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Fri, 20 Feb 2015 17:34:58 -0500 Subject: [PATCH 2/2] Added new parameter to CcFiles::createFromLocalFile() for flexibility --- airtime_mvc/application/models/airtime/CcFiles.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php index e27bed4a9..eb50f8821 100644 --- a/airtime_mvc/application/models/airtime/CcFiles.php +++ b/airtime_mvc/application/models/airtime/CcFiles.php @@ -119,9 +119,8 @@ class CcFiles extends BaseCcFiles { * @param bool $copyFile True if you want to just copy the false, false if you want to move it (default false) * @throws Exception */ - public static function createFromLocalFile($filePath, $copyFile=false) + public static function createFromLocalFile($fileArray, $filePath, $copyFile=false) { - $fileArray = array(); $info = pathinfo($filePath); $fileName = basename($filePath).'.'.$info['extension']; self::createAndImport($fileArray, $filePath, $fileName, $copyFile);