#!/usr/bin/env php . * * @category Installation * @package Installation * * @author Brion Vibber * @author Evan Prodromou * @license GNU Affero General Public License http://www.gnu.org/licenses/ * @version 1.0.0 * @link http://status.net */ if (php_sapi_name() !== 'cli') { exit(1); } define('INSTALLDIR', dirname(dirname(__FILE__))); set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib'); require_once INSTALLDIR . '/lib/installer.php'; class EmailMultihomeInstaller extends Installer { protected $address; function __construct($address) { $this->address = $address; } /** * Go for it! * @return boolean success */ function main() { if (!$this->checkPrereqs()) { return false; } if ($this->prepare()) { return $this->handle(); } else { $this->showHelp(); return false; } } /** * Get our input parameters... * @return boolean success */ function prepare() { } function handle() { return $this->doInstall(); } function showHelp() { print "USAGE: installbyemail.php "; } function warning($message, $submessage='') { print $this->html2text($message) . "\n"; if ($submessage != '') { print " " . $this->html2text($submessage) . "\n"; } print "\n"; } function updateStatus($status, $error=false) { if ($this->verbose || $error) { if ($error) { print "ERROR: "; } print $this->html2text($status); print "\n"; } } private function html2text($html) { // break out any links for text legibility $breakout = preg_replace('/+]\bhref="(.*)"[^>]*>(.*)<\/a>/', '\2 <\1>', $html); return html_entity_decode(strip_tags($breakout), ENT_QUOTES, 'UTF-8'); } } $installer = new EmailMultihomeInstaller(); $ok = $installer->main($argv[1]); exit($ok ? 0 : 1);