Revision: 479
Author: nemako
Date: 2006-04-27 04:49:10 -0700 (Thu, 27 Apr 2006)
ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=479&view=rev
Log Message:
-----------
+ use file_get_contents instead of fileopen to read pfc version
Modified Paths:
--------------
trunk/admin/version.class.php
Modified: trunk/admin/version.class.php
===================================================================
--- trunk/admin/version.class.php 2006-04-27 10:09:45 UTC (rev 478)
+++ trunk/admin/version.class.php 2006-04-27 11:49:10 UTC (rev 479)
@@ -20,10 +20,7 @@
* @return integer version
*/
function getLocalVersion(){
- $fp = fopen($this->local_version,"r");
- $version = trim(fgets($fp));
- fclose($fp);
- return $version;
+ return file_get_contents($this->local_version);
}
/**
@@ -34,14 +31,11 @@
$parse = parse_url($this->pfc_official_current_version);
$host = $parse['host'];
error_reporting(0); // It's maybe not the best thing to do...
- if (!fsockopen ($host, 80, $errno, $errstr, 1)) {
+ if (!fsockopen ($host, 80, $errno, $errstr, 2)) {
return 0;
}
else{
- $fp = fopen($this->pfc_official_current_version,"r");
- $version = trim(fgets($fp));
- fclose($fp);
- return $version;
+ return file_get_contents($this->pfc_official_current_version);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|