summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorBen Coburn <btcoburn@silicodon.net>2006-09-08 21:34:33 +0200
committerBen Coburn <btcoburn@silicodon.net>2006-09-08 21:34:33 +0200
commitd818621633e2c687264682f0504869858f9c780d (patch)
tree47988890038f1229b3040a7deefaf523e075b367 /inc
parent4b5f4f4ed319790fe7f0729560616b55c4e64715 (diff)
downloadrpg-d818621633e2c687264682f0504869858f9c780d.tar.gz
rpg-d818621633e2c687264682f0504869858f9c780d.tar.bz2
suppress boring errors
Suppress any errors from set_time_limit, unlink, and file_exists functions. see: http://www.freelists.org/archives/dokuwiki/09-2006/msg00004.html darcs-hash:20060908193433-05dcb-013617431870ab5bfb2ce8c6e99ba5af13493228.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/common.php24
-rw-r--r--inc/init.php2
-rw-r--r--inc/io.php4
-rw-r--r--inc/pageutils.php4
-rw-r--r--inc/pluginutils.php2
-rw-r--r--inc/template.php2
6 files changed, 19 insertions, 19 deletions
diff --git a/inc/common.php b/inc/common.php
index 65ea4c897..ca60b8edc 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -538,7 +538,7 @@ function checklock($id){
//lockfile expired
if((time() - filemtime($lock)) > $conf['locktime']){
- unlink($lock);
+ @unlink($lock);
return false;
}
@@ -898,7 +898,7 @@ function getRevisionInfo($id, $rev, $chunk_size=8192) {
}
$file = metaFN($id, '.changes');
- if (!file_exists($file)) { return false; }
+ if (!@file_exists($file)) { return false; }
if (filesize($file)<$chunk_size || $chunk_size==0) {
// read whole file
$lines = file($file);
@@ -995,12 +995,12 @@ function getRevisions($id, $first, $num, $chunk_size=8192) {
$num = max($num, 0);
$chunk_size = max($chunk_size, 0);
if ($first<0) { $first = 0; }
- else if (file_exists(wikiFN($id))) {
+ else if (@file_exists(wikiFN($id))) {
// skip current revision if the page exists
$first = max($first+1, 0);
}
- if (!file_exists($file)) { return $revs; }
+ if (!@file_exists($file)) { return $revs; }
if (filesize($file)<$chunk_size || $chunk_size==0) {
// read whole file
$lines = file($file);
@@ -1085,7 +1085,7 @@ function saveWikiText($id,$text,$summary,$minor=false){
$file = wikiFN($id);
$old = saveOldRevision($id);
$wasRemoved = empty($text);
- $wasCreated = !file_exists($file);
+ $wasCreated = !@file_exists($file);
$wasReverted = ($REV==true);
if ($wasRemoved){
@@ -1096,7 +1096,7 @@ function saveWikiText($id,$text,$summary,$minor=false){
$changelog = metaFN($id, '.changes');
foreach ($mfiles as $mfile) {
// but keep per-page changelog to preserve page history
- if (file_exists($mfile) && $mfile!==$changelog) { @unlink($mfile); }
+ if (@file_exists($mfile) && $mfile!==$changelog) { @unlink($mfile); }
}
$del = true;
// autoset summary on deletion
@@ -1351,20 +1351,20 @@ function check(){
if(is_writable($conf['changelog'])){
msg('Changelog is writable',1);
}else{
- if (file_exists($conf['changelog'])) {
+ if (@file_exists($conf['changelog'])) {
msg('Changelog is not writable',-1);
}
}
- if (isset($conf['changelog_old']) && file_exists($conf['changelog_old'])) {
+ if (isset($conf['changelog_old']) && @file_exists($conf['changelog_old'])) {
msg('Old changelog exists.', 0);
}
- if (file_exists($conf['changelog'].'_failed')) {
+ if (@file_exists($conf['changelog'].'_failed')) {
msg('Importing old changelog failed.', -1);
- } else if (file_exists($conf['changelog'].'_importing')) {
+ } else if (@file_exists($conf['changelog'].'_importing')) {
msg('Importing old changelog now.', 0);
- } else if (file_exists($conf['changelog'].'_import_ok')) {
+ } else if (@file_exists($conf['changelog'].'_import_ok')) {
msg('Old changelog imported.', 1);
}
@@ -1467,7 +1467,7 @@ function subscriber_addresslist($id){
$mlist = array();
$file=metaFN($id,'.mlist');
- if (file_exists($file)) {
+ if (@file_exists($file)) {
$mlist = file($file);
}
if(count($mlist) > 0) {
diff --git a/inc/init.php b/inc/init.php
index 69dd4766b..2ba16c2c3 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -17,7 +17,7 @@
if(!defined('DOKU_CONF')) define('DOKU_CONF',DOKU_INC.'conf/');
// check for error reporting override or set error reporting to sane values
- if (!defined('DOKU_E_LEVEL') && file_exists(DOKU_CONF.'report_e_all')) {
+ if (!defined('DOKU_E_LEVEL') && @file_exists(DOKU_CONF.'report_e_all')) {
define('DOKU_E_LEVEL', E_ALL);
}
if (!defined('DOKU_E_LEVEL')) { error_reporting(E_ALL ^ E_NOTICE); }
diff --git a/inc/io.php b/inc/io.php
index f9fbbd103..2b1272675 100644
--- a/inc/io.php
+++ b/inc/io.php
@@ -170,7 +170,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'){
@@ -470,7 +470,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);
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 5fadd7a36..69e04f489 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -169,9 +169,9 @@ function wikiFN($raw_id,$rev='',$clean=true){
$fn = $conf['olddir'].'/'.utf8_encodeFN($id).'.'.$rev.'.txt';
if($conf['compression']){
//test for extensions here, we want to read both compressions
- if (file_exists($fn . '.gz')){
+ if (@file_exists($fn . '.gz')){
$fn .= '.gz';
- }else if(file_exists($fn . '.bz2')){
+ }else if(@file_exists($fn . '.bz2')){
$fn .= '.bz2';
}else{
//file doesnt exist yet, so we take the configured extension
diff --git a/inc/pluginutils.php b/inc/pluginutils.php
index a93cca936..0adba09f3 100644
--- a/inc/pluginutils.php
+++ b/inc/pluginutils.php
@@ -73,7 +73,7 @@ function &plugin_load($type,$name){
}
//try to load the wanted plugin file
- if (file_exists(DOKU_PLUGIN."$name/$type.php")){
+ if (@file_exists(DOKU_PLUGIN."$name/$type.php")){
include_once(DOKU_PLUGIN."$name/$type.php");
}else{
list($plugin, $component) = preg_split("/_/",$name, 2);
diff --git a/inc/template.php b/inc/template.php
index 81913a8e7..7392b5413 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -635,7 +635,7 @@ function tpl_youarehere($sep=' &raquo; '){
$page = $part.$parts[$i];
if($page == $conf['start']) return;
echo $sep;
- if(file_exists(wikiFN($page))){
+ if(@file_exists(wikiFN($page))){
$title = p_get_first_heading($page);
if(!$title) $title = $parts[$i];
tpl_link(wl($page),$title,'title="'.$page.'"');