summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-09-05 11:29:01 +0000
committerxue <>2006-09-05 11:29:01 +0000
commit8f1fa1c2bb6c2b7cbb493bd2038669b1e1a8ca7d (patch)
tree01cb88f4d17f0c9f53a837cfaec2b5d2a52d912a
parentf587496dcba7c7030062b5dfdc7612f3ed89dbf9 (diff)
Fixed #358.
-rw-r--r--HISTORY4
-rw-r--r--UPGRADE8
-rw-r--r--framework/PradoBase.php2
-rw-r--r--framework/Web/UI/WebControls/TFileUpload.php11
-rw-r--r--index.html2
5 files changed, 18 insertions, 9 deletions
diff --git a/HISTORY b/HISTORY
index 76a76d8d..f4cce8e9 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,3 +1,7 @@
+Version 3.0.5 October 8, 2006
+===============================
+CHG: Ticket#358 - TFileUpload::saveAs() now returns false instead of exception when error (Qiang)
+
Version 3.0.4 September 4, 2006
===============================
BUG: Fixed a bug that would prevent from using <prop:> tag in skins (Qiang)
diff --git a/UPGRADE b/UPGRADE
index 19cb8141..3b421dfc 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -1,5 +1,5 @@
- Upgrading Instructions for PRADO Framework v3.0.4
+ Upgrading Instructions for PRADO Framework v3.0.5
=================================================
!!!IMPORTANT!!!
@@ -13,6 +13,12 @@ if you want to upgrade from version A to version C and there is
version B between A and C, you need to following the instructions
for both A and B.
+Upgrading from v3.0.4
+---------------------
+- TFileUpload::saveAs() will return false instead of raising an exception
+ if it encounters any error.
+
+
Upgrading from v3.0.3
---------------------
- The 'Static' value is changed to 'Fixed' for the Display property of
diff --git a/framework/PradoBase.php b/framework/PradoBase.php
index cda172a3..108cf1e7 100644
--- a/framework/PradoBase.php
+++ b/framework/PradoBase.php
@@ -68,7 +68,7 @@ class PradoBase
*/
public static function getVersion()
{
- return '3.0.4';
+ return '3.0.5';
}
/**
diff --git a/framework/Web/UI/WebControls/TFileUpload.php b/framework/Web/UI/WebControls/TFileUpload.php
index 62c51ccf..17bdcf5b 100644
--- a/framework/Web/UI/WebControls/TFileUpload.php
+++ b/framework/Web/UI/WebControls/TFileUpload.php
@@ -174,22 +174,21 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata
* @param string the file name used to save the uploaded file
* @param boolean whether to delete the temporary file after saving.
* If true, you will not be able to save the uploaded file again.
- * @throws TInvalidOperationException file uploading failed or the uploaded
- * file cannot be found on the server.
+ * @return boolean true if the file saving is successful
*/
public function saveAs($fileName,$deleteTempFile=true)
{
if($this->_errorCode===UPLOAD_ERR_OK)
{
if($deleteTempFile)
- move_uploaded_file($this->_localName,$fileName);
+ return move_uploaded_file($this->_localName,$fileName);
else if(is_uploaded_file($this->_localName))
- file_put_contents($fileName,file_get_contents($this->_localName));
+ return file_put_contents($fileName,file_get_contents($this->_localName))!==false
else
- throw new TInvalidOperationException('fileupload_saveas_failed');
+ return false;
}
else
- throw new TInvalidOperationException('fileupload_saveas_forbidden');
+ return false;
}
/**
diff --git a/index.html b/index.html
index d6c5e19a..01cd2520 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
<body>
<h1>PRADO Framework for PHP 5 </h1>
-<p>Version 3.0.4, September 4, 2006<br>
+<p>Version 3.0.5, October 8, 2006<br>
Copyright&copy; 2004-2006 by <a href="http://www.pradosoft.com/">PradoSoft</a><br>
All Rights Reserved.
</p>