/** * create the notification script */ function set_notifier() { unset_notifier(); $dataroot = elgg_get_config('dataroot'); $contents = file_get_contents(__DIR__ . '/lib/template.php'); $emails = ''; $email_string = elgg_get_plugin_setting('emails', PLUGIN_ID); if ($email_string) { $emails = array_unique(array_map('trim', explode("\n", $email_string))); foreach ($emails as $key => $e) { if (!is_email_address($e)) { unset($emails[$key]); } $emails[$key] = "'{$e}'"; } } $contents = str_replace('{{emails}}', implode(', ', $emails), $contents); $html = elgg_get_plugin_setting('html', PLUGIN_ID); $file = elgg_get_config('dataroot') . NOTIFIER; file_put_contents($file, $contents); $file = elgg_get_config('dataroot') . HTML; file_put_contents($file, $html); }
<?php namespace MBeckett\Exception\Notifier; unset_notifier();