public function __construct($message = null, $code = 0) { if (!file_exists("./log_files")) { mkdir('./log_files'); } $this->log_file = './log_files/Log.txt'; if (!$message) { throw new $this('Unknown ' . get_class($this)); } Analog::handler(Analog\Handler\File::init($this->log_file)); parent::__construct($message, $code); Analog::log($this->__toString(), Analog::ERROR); $handleFilesFolder = new HandleFilesFolder(); $handleFilesFolder->handle(); if (file_exists("FTP_SEMAMPHORE.smph")) { unlink("FTP_SEMAMPHORE.smph"); } }
public function __construct($message = "Unknown error", $code = 0) { if (!file_exists(MD_LOG_FILE_DIR)) { mkdir(MD_LOG_FILE_DIR); } $this->log_file = MD_LOG_FILE_DIR . '/Log.txt'; if (!$message) { throw new $this('Unknown ' . get_class($this)); } Analog::handler(Analog\Handler\File::init($this->log_file)); if (gettype($message) !== "string") { $message = "Unknown error"; } parent::__construct($message, 10); Analog::log($this->__toString(), Analog::ERROR); $handleFilesFolder = new HandleFilesFolder(); $handleFilesFolder->handle(); if (file_exists(MD_ROOT . "/FTP_SEMAMPHORE.smph")) { unlink(MD_ROOT . "/FTP_SEMAMPHORE.smph"); } }