Revision: 1264
http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1264&view=rev
Author: kerphi
Date: 2009-08-25 07:31:59 +0000 (Tue, 25 Aug 2009)
Log Message:
-----------
Removes the log proxy if the filesystem can't manage file locking functionnality
Modified Paths:
--------------
trunk/src/pfcglobalconfig.class.php
Modified: trunk/src/pfcglobalconfig.class.php
===================================================================
--- trunk/src/pfcglobalconfig.class.php 2009-04-26 13:10:07 UTC (rev 1263)
+++ trunk/src/pfcglobalconfig.class.php 2009-08-25 07:31:59 UTC (rev 1264)
@@ -934,7 +934,7 @@
$ct_errors = $ct->init($this);
$this->errors = array_merge($this->errors, $ct_errors);
- // check the language is known
+ // check if the wanted language is known
$lg_list = pfcI18N::GetAcceptedLanguage();
if ( $this->language != "" && !in_array($this->language, $lg_list) )
$this->errors[] = _pfc("'%s' parameter is not valid. Available values are : '%s'", "language", implode(", ", $lg_list));
@@ -959,6 +959,21 @@
$this->proxies[] = $px;
}
+
+ if (in_array('log',$this->proxies)) {
+ // test the LOCK_EX feature because the log proxy needs to write in a file
+ $filename = $c->data_private_path.'/filemtime2.test';
+ if (is_writable(dirname($filename)))
+ {
+ $data1 = time();
+ file_put_contents($filename, $data1, LOCK_EX);
+ $data2 = file_get_contents($filename);
+ if ($data1 != $data2) {
+ unset($this->proxies[array_search('log',$this->proxies)]);
+ }
+ }
+ }
+
// save the proxies path
$this->proxies_path_default = dirname(__FILE__).'/proxies';
// check the customized proxies path
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|