[Phpfreechat-svn] SF.net SVN: phpfreechat: [927] trunk/src/pfcglobalconfig.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2007-01-12 16:29:24
|
Revision: 927 http://svn.sourceforge.net/phpfreechat/?rev=927&view=rev Author: kerphi Date: 2007-01-12 08:29:19 -0800 (Fri, 12 Jan 2007) Log Message: ----------- bug fix : the data_public_path javascript content was not correctly copied when the data_public_path parameter was not the default. [1h] Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2007-01-06 12:45:49 UTC (rev 926) +++ trunk/src/pfcglobalconfig.class.php 2007-01-12 16:29:19 UTC (rev 927) @@ -339,9 +339,27 @@ // $this->errors = array_merge($this->errors, @test_writable_dir($this->data_public_path, "data_public_path")); $this->errors = array_merge($this->errors, @test_writable_dir($this->data_private_path, "data_private_path")); - // $this->errors = array_merge($this->errors, @install_dir($this->jspath, $this->data_public_path."/javascript")); $this->errors = array_merge($this->errors, @test_writable_dir($this->data_private_path."/cache", "data_private_path/cache")); + + // install the public directory content + $dir = dirname(__FILE__)."/../data/public/js"; + $dh = opendir($dir); + while (false !== ($file = readdir($dh))) + { + $f_src = $dir.'/'.$file; + $f_dst = $this->data_public_path.'/js/'.$file; + if ($file == "." || $file == ".." || !is_file($f_src)) continue; // skip . and .. generic files + // install js files only if the destination doesn't exists or if the destination timestamp is older than the source timestamp + if (!file_exists($f_dst) || filemtime($f_dst) < filemtime($f_src) ) + { + mkdir_r($this->data_public_path.'/js/'); + copy( $f_src, $f_dst ); + } + if (!file_exists($f_dst)) $this->errors[] = _pfc("%s doesn't exist, data_public_path cannot be installed", $f_dst); + } + closedir($dh); + // --- // test xajax lib existance $dir = $this->xajaxpath; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |