[Gforge-devel] [gforge-Patches][2529] error not caught on cachePath open

gforge-patches at gforge.org gforge-patches at gforge.org
Mon Jun 5 05:46:01 EDT 2006


Patches item #2529, was opened at 05/06/2006 11:46
You can respond by visiting: 
http://gforge.org/tracker/?func=detail&atid=106&aid=2529&group_id=1
Or by replying to this e-mail entering your response between the following markers: 
#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+
(enter your response here)
#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+

Status: Open
Priority: 3
Submitted By: Yann Dirson (ydirson)
Assigned to: Nobody (None)
Summary: error not caught on cachePath open 
Category: None
Group: None
Resolution: None
Written For: v4.5.6


Initial Comment:
If the $cachePath cannot be openned for some reason, we should report the problem instead of trying to use it and produce more errors in the log:

diff --git a/www/include/BaseLanguage.class b/www/include/BaseLanguage.class
index fd1f243..437f2b4 100644
--- a/www/include/BaseLanguage.class
+++ b/www/include/BaseLanguage.class
@@ -364,6 +364,10 @@ class BaseLanguage {
                        $content['pluginDependencies'] =& $this->pluginDependencies;
                        $content['text'] =& $this->textArray;
                        $fp = fopen($cachePath, 'a');
+                       if ($fp == false) {
+                               echo "fopen(".$cachePath.") failed\n";
+                               return;
+                       }
                        flock($fp, LOCK_EX);
                        ftruncate($fp, 0);
                        $content = serialize($content);


----------------------------------------------------------------------

You can respond by visiting: 
http://gforge.org/tracker/?func=detail&atid=106&aid=2529&group_id=1


More information about the Gforge-devel mailing list