summaryrefslogtreecommitdiff
path: root/inc/io.php
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2015-01-07 10:47:45 +0100
committerAndreas Gohr <gohr@cosmocode.de>2015-01-07 10:47:45 +0100
commit79e79377626799a77c11aa7849cb9c64305590c8 (patch)
tree0d359f6b0985fd29f2c854d232578881e636b8c1 /inc/io.php
parentcb339ea7ee2b684b0fd0fb948681c66b76a0b4e1 (diff)
downloadrpg-79e79377626799a77c11aa7849cb9c64305590c8.tar.gz
rpg-79e79377626799a77c11aa7849cb9c64305590c8.tar.bz2
Remove error supression for file_exists()
In an older version of PHP a file_exists() call would issue a warning when the file did not exist. This was fixed in later PHP releases. Since we require PHP 5.3 now, there's no need to supress any error here anymore. This might even give a minor performance boost.
Diffstat (limited to 'inc/io.php')
-rw-r--r--inc/io.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/inc/io.php b/inc/io.php
index bfa394a17..3ed227162 100644
--- a/inc/io.php
+++ b/inc/io.php
@@ -105,7 +105,7 @@ function _io_readWikiPage_action($data) {
*/
function io_readFile($file,$clean=true){
$ret = '';
- if(@file_exists($file)){
+ if(file_exists($file)){
if(substr($file,-3) == '.gz'){
$ret = join('',gzfile($file));
}else if(substr($file,-4) == '.bz2'){
@@ -204,7 +204,7 @@ function io_saveFile($file,$content,$append=false){
global $conf;
$mode = ($append) ? 'ab' : 'wb';
- $fileexists = @file_exists($file);
+ $fileexists = file_exists($file);
io_makeFileDir($file);
io_lock($file);
if(substr($file,-3) == '.gz'){
@@ -258,7 +258,7 @@ function io_saveFile($file,$content,$append=false){
* @return bool true on success
*/
function io_deleteFromFile($file,$badline,$regex=false){
- if (!@file_exists($file)) return true;
+ if (!file_exists($file)) return true;
io_lock($file);
@@ -385,7 +385,7 @@ function io_createNamespace($id, $ns_type='pages') {
$ns_stack = explode(':', $id);
$ns = $id;
$tmp = dirname( $file = call_user_func($types[$ns_type], $ns) );
- while (!@is_dir($tmp) && !(@file_exists($tmp) && !is_dir($tmp))) {
+ while (!@is_dir($tmp) && !(file_exists($tmp) && !is_dir($tmp))) {
array_pop($ns_stack);
$ns = implode(':', $ns_stack);
if (strlen($ns)==0) { break; }
@@ -429,7 +429,7 @@ function io_makeFileDir($file){
function io_mkdir_p($target){
global $conf;
if (@is_dir($target)||empty($target)) return 1; // best case check first
- if (@file_exists($target) && !is_dir($target)) return 0;
+ if (file_exists($target) && !is_dir($target)) return 0;
//recursion
if (io_mkdir_p(substr($target,0,strrpos($target,'/')))){
if($conf['safemodehack']){
@@ -606,7 +606,7 @@ function io_download($url,$file,$useAttachment=false,$defaultName='',$maxSize=20
$file = $file.$name;
}
- $fileexists = @file_exists($file);
+ $fileexists = file_exists($file);
$fp = @fopen($file,"w");
if(!$fp) return false;
fwrite($fp,$data);