LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: Philip Olson Date: Mon May 26 14:42:23 2008 Subject: cvs: docweb /include lib_general.inc.php
philip Mon May 26 20:42:23 2008 UTC
Modified files:
/docweb/include lib_general.inc.php
Log:
fix logic
# hopefully the last fix *sigh*
http://cvs.php.net/viewvc.cgi/docweb/include/lib_general.inc.php?r1=1.61&r2=1.62&diff_format=u
Index: docweb/include/lib_general.inc.php
diff -u docweb/include/lib_general.inc.php:1.61 docweb/include/lib_general.inc.php:1.62
--- docweb/include/lib_general.inc.php:1.61 Mon May 26 20:30:49 2008
+++ docweb/include/lib_general.inc.php Mon May 26 20:42:23 2008
@@ -18,7 +18,7 @@
| Gabor Hojtsy <goba@php.net> |
| Sean Coates <sean@php.net> |
+----------------------------------------------------------------------+
-$Id: lib_general.inc.php,v 1.61 2008/05/26 20:30:49 philip Exp $
+$Id: lib_general.inc.php,v 1.62 2008/05/26 20:42:23 philip Exp $
*/
require_once dirname(__FILE__) . '/lib_auth.inc.php';
@@ -255,14 +255,6 @@
$localFile = FILES_DIR . "bugs_{$project}.count";
- // Cached (CACHE_BUGS_COUNT defined in init.inc.php)
- if ((is_readable($localFile) && (filemtime($localFile) > (time() - CACHE_BUGS_COUNT)))) {
- $count = file_get_contents($localFile);
- if (strlen($count) > 0) {
- return (int) $count;
- }
- }
-
switch ($project)
{
case 'php':
@@ -290,12 +282,20 @@
return false;
}
- if (!$count = file_get_contents($link)) {
- return false;
+ // Cached (CACHE_BUGS_COUNT defined in init.inc.php)
+ if (!(is_readable($localFile) && (filemtime($localFile) > (time() - CACHE_BUGS_COUNT)))) {
+ if (!$count = file_get_contents($link)) {
+ return false;
+ }
+ file_put_contents($localFile, $count);
+ } else {
+ $count = file_get_contents($localFile);
}
- file_put_contents($localFile, $count);
-
- return array ('count' => (int) $count,
- 'link' => $link,
- );
+
+ if (strlen($count) > 0) {
+ return array ('count' => (int) $count,
+ 'link' => $link,
+ );
+ }
+ return false;
}
| Navigate in group php.doc.web at sever news.php.net | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |