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
This commit is contained in:
Ben Coburn 2006-09-08 21:34:33 +02:00
parent 4b5f4f4ed3
commit d818621633
11 changed files with 31 additions and 31 deletions

View File

@ -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) {

View File

@ -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); }

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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.'"');

View File

@ -35,7 +35,7 @@
if($AUTH >= AUTH_READ){
// check if image exists
$SRC = mediaFN($IMG);
if(!file_exists($SRC)){
if(!@file_exists($SRC)){
//doesn't exist!
}

View File

@ -47,8 +47,8 @@ function runTrimRecentChanges() {
// Uses the imporoldchangelog plugin to upgrade the changelog automaticaly.
// FIXME: Remove this from runTrimRecentChanges when it is no longer needed.
if (isset($conf['changelog_old']) &&
file_exists($conf['changelog_old']) && !file_exists($conf['changelog']) &&
!file_exists($conf['changelog'].'_importing') && !file_exists($conf['changelog'].'_tmp')) {
@file_exists($conf['changelog_old']) && !@file_exists($conf['changelog']) &&
!@file_exists($conf['changelog'].'_importing') && !@file_exists($conf['changelog'].'_tmp')) {
$tmp = array(); // no event data
trigger_event('TEMPORARY_CHANGELOG_UPGRADE_EVENT', $tmp);
return true;
@ -58,9 +58,9 @@ function runTrimRecentChanges() {
// Trims the recent changes cache to the last $conf['changes_days'] recent
// changes or $conf['recent'] items, which ever is larger.
// The trimming is only done once a day.
if (file_exists($conf['changelog']) &&
if (@file_exists($conf['changelog']) &&
(filectime($conf['changelog'])+86400)<time() &&
!file_exists($conf['changelog'].'_tmp')) {
!@file_exists($conf['changelog'].'_tmp')) {
io_lock($conf['changelog']);
$lines = file($conf['changelog']);
if (count($lines)<$conf['recent']) {
@ -86,12 +86,12 @@ function runTrimRecentChanges() {
}
}
io_saveFile($conf['changelog'].'_tmp', implode('', $out_lines));
unlink($conf['changelog']);
@unlink($conf['changelog']);
if (!rename($conf['changelog'].'_tmp', $conf['changelog'])) {
// rename failed so try another way...
io_unlock($conf['changelog']);
io_saveFile($conf['changelog'], implode('', $out_lines));
unlink($conf['changelog'].'_tmp');
@unlink($conf['changelog'].'_tmp');
} else {
io_unlock($conf['changelog']);
}

View File

@ -190,7 +190,7 @@ if (!class_exists('configuration')) {
$local = eval('return '.$this->_local_file.';');
if (!is_writable(dirname($local))) return true;
if (file_exists($local) && !is_writable($local)) return true;
if (@file_exists($local) && !is_writable($local)) return true;
return false;
}

View File

@ -117,7 +117,7 @@ class action_plugin_importoldchangelog extends DokuWiki_Action_Plugin {
function resetTimer() {
// Add 5 minutes to the script execution timer...
// This should be much more than needed.
set_time_limit(5*60);
@set_time_limit(5*60);
// Note: Has no effect in safe-mode!
}
@ -150,7 +150,7 @@ class action_plugin_importoldchangelog extends DokuWiki_Action_Plugin {
ksort($recent); // ensure correct order of recent changes
io_unlock($conf['changelog']); // hand off the lock to io_saveFile
io_saveFile($conf['changelog'], implode('', $recent));
unlink($conf['changelog'].'_importing'); // changelog importing unlock
@unlink($conf['changelog'].'_importing'); // changelog importing unlock
}
}
@ -163,7 +163,7 @@ function importoldchangelog_plugin_shutdown() {
$path['failed'] = $conf['changelog'].'_failed';
$path['import_ok'] = $conf['changelog'].'_import_ok';
io_unlock($path['changelog']); // guarantee unlocking
if (file_exists($path['importing'])) {
if (@file_exists($path['importing'])) {
// import did not finish
rename($path['importing'], $path['failed']) or trigger_error('Importing changelog failed.', E_USER_WARNING);
@unlink($path['import_ok']);

View File

@ -723,7 +723,7 @@ class ap_manage {
$path = DOKU_PLUGIN.$plugin.'/';
foreach ($plugin_types as $type) {
if (file_exists($path.$type.'.php')) { $components[] = array('name'=>$plugin, 'type'=>$type); continue; }
if (@file_exists($path.$type.'.php')) { $components[] = array('name'=>$plugin, 'type'=>$type); continue; }
if ($dh = @opendir($path.$type.'/')) {
while (false !== ($cp = readdir($dh))) {