1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| <?php
/**
* @fonctionment Register all the error in a log file
* @author Marwan Rabbaa
* @version 1.0
* @since 05/03/2008
*/
class FileHandler extends Exception
{
private $directory; // the direcory where is stored HTML files
private $logfile;
/** The constructor
*/
public function __construct()
{
$this->directory = 'error/';
$this->logfile = new LogFile("err");
}
/** The only public method
* @action Write in a file and redirect user to an error page
*/
public function handle($e)
{
header($this->directory.'application.php');
$this->logfile->write('ERROR');
}
} |