/** * write function. * writes an archive. * * @access public * @param string $archivePath * @return void */ public function write(string $archivePath) { echo '<pre>'; echo var_export($archivePath); echo '</pre>'; Log::append('Dummy output to browser!', 1); }
/** * log function. * Log the exception depending on the application config * * @access public * @static * @param \Throwable $throwable The exception * @return void */ public static function log(\Throwable $throwable) { Log::append($throwable->getMessage(), 2); }
/** * runGenerator function. * instantiates a generator and processes its file list * * @access * @param $generatorName * @param array $arguments * @return Backup */ private function generate(string $generatorName, $arguments = []) : Backup { // format the generator name $generatorClass = 'Radiergummi\\Anacronism\\Modules\\Generators\\' . ucfirst(strtolower($generatorName)); // create a new generator instance, passing all arguments as parameters $generator = new $generatorClass($this->basePath, ...$arguments); try { // retrieve a list of files to include in the archive $files = $generator->getFileList(); // add each file to the file list $this->fileList = array_merge($this->fileList, $files); } catch (\Exception $e) { // append this incidence to the logfile Log::append($e->getMessage()); } // return object for chaining return $this; }