Some exceptions raising added.
This commit is contained in:
parent
aead81fe1b
commit
e6233ff3fc
1 changed files with 12 additions and 3 deletions
|
@ -65,7 +65,11 @@ class Crontab
|
|||
*/
|
||||
function readCrontab()
|
||||
{
|
||||
exec("crontab -u {$this->user} -l", $crons, $return);
|
||||
@exec("crontab -u {$this->user} -l", $crons, $return);
|
||||
if($return != 0){
|
||||
return PEAR::raiseError("*** Can't read crontab ***\n".
|
||||
" Set crontab manually!\n");
|
||||
}
|
||||
|
||||
foreach ($crons as $line)
|
||||
{
|
||||
|
@ -146,8 +150,13 @@ class Crontab
|
|||
|
||||
// echo "line $i : $line\n";
|
||||
|
||||
if ($line)
|
||||
fwrite($file, $line."\n");
|
||||
if ($line){
|
||||
$r = @fwrite($file, $line."\n");
|
||||
if($r === FALSE){
|
||||
return PEAR::raiseError("*** Can't write crontab ***\n".
|
||||
" Set crontab manually!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($file);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue