commit 4dc22474951ab24d4689b882faa867e66a266a57 Author: Andreas Gohr Date: Sun Jul 26 12:16:39 2015 +0200 wizard generated initial checkin diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..bbfc742 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +# Config file for travis-ci.org + +language: php +php: + - "5.5" + - "5.4" + - "5.3" +env: + - DOKUWIKI=master + - DOKUWIKI=stable +before_install: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/travis.sh +install: sh travis.sh +script: cd _test && phpunit --stderr --group plugin_smtp \ No newline at end of file diff --git a/README b/README new file mode 100644 index 0000000..040ff1b --- /dev/null +++ b/README @@ -0,0 +1,27 @@ +smtp Plugin for DokuWiki + +Send mails via a configured SMTP server + +All documentation for this plugin can be found at +https://www.dokuwiki.org/plugin:smtp + +If you install this plugin manually, make sure it is installed in +lib/plugins/smtp/ - if the folder is called different it +will not work! + +Please refer to http://www.dokuwiki.org/plugins for additional info +on how to install plugins in DokuWiki. + +---- +Copyright (C) Andreas Gohr + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +See the COPYING file in your DokuWiki folder for details diff --git a/_test/general.test.php b/_test/general.test.php new file mode 100644 index 0000000..84c1ac6 --- /dev/null +++ b/_test/general.test.php @@ -0,0 +1,33 @@ +assertFileExists($file); + + $info = confToHash($file); + + $this->assertArrayHasKey('base', $info); + $this->assertArrayHasKey('author', $info); + $this->assertArrayHasKey('email', $info); + $this->assertArrayHasKey('date', $info); + $this->assertArrayHasKey('name', $info); + $this->assertArrayHasKey('desc', $info); + $this->assertArrayHasKey('url', $info); + + $this->assertEquals('smtp', $info['base']); + $this->assertRegExp('/^https?:\/\//', $info['url']); + $this->assertTrue(mail_isvalid($info['email'])); + $this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']); + $this->assertTrue(false !== strtotime($info['date'])); + } +} diff --git a/action.php b/action.php new file mode 100644 index 0000000..d9dce38 --- /dev/null +++ b/action.php @@ -0,0 +1,40 @@ + + */ + +// must be run within Dokuwiki +if(!defined('DOKU_INC')) die(); + +class action_plugin_smtp extends DokuWiki_Action_Plugin { + + /** + * Registers a callback function for a given event + * + * @param Doku_Event_Handler $controller DokuWiki's event controller object + * @return void + */ + public function register(Doku_Event_Handler $controller) { + + $controller->register_hook('MAIL_MESSAGE_SEND', 'FIXME', $this, 'handle_mail_message_send'); + + } + + /** + * [Custom event handler which performs action] + * + * @param Doku_Event $event event object by reference + * @param mixed $param [the parameters passed as fifth argument to register_hook() when this + * handler was registered] + * @return void + */ + + public function handle_mail_message_send(Doku_Event &$event, $param) { + } + +} + +// vim:ts=4:sw=4:et: diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..bc6736f --- /dev/null +++ b/admin.php @@ -0,0 +1,48 @@ + + */ + +// must be run within Dokuwiki +if(!defined('DOKU_INC')) die(); + +class admin_plugin_smtp extends DokuWiki_Admin_Plugin { + + /** + * @return int sort number in admin menu + */ + public function getMenuSort() { + return 500; + } + + /** + * @return bool true if only access for superuser, false is for superusers and moderators + */ + public function forAdminOnly() { + return false; + } + + /** + * Should carry out any processing required by the plugin. + */ + public function handle() { + } + + /** + * Render HTML output, e.g. helpful text and a form + */ + public function html() { + ptln('

'.$this->getLang('menu').'

'); + + + require_once __DIR__.'/Mailer/Mailer/SMTP.php'; + $mailer = new Tx\Mailer\SMTP(); + $mailer->setServer() + + } +} + +// vim:ts=4:sw=4:et: diff --git a/conf/default.php b/conf/default.php new file mode 100644 index 0000000..2554dcb --- /dev/null +++ b/conf/default.php @@ -0,0 +1,8 @@ + + */ + +//$conf['fixme'] = 'FIXME'; diff --git a/conf/metadata.php b/conf/metadata.php new file mode 100644 index 0000000..52f3e09 --- /dev/null +++ b/conf/metadata.php @@ -0,0 +1,10 @@ + + */ + + +//$meta['fixme'] = array('string'); + diff --git a/helper.php b/helper.php new file mode 100644 index 0000000..a52f1df --- /dev/null +++ b/helper.php @@ -0,0 +1,38 @@ + + */ + +// must be run within Dokuwiki +if(!defined('DOKU_INC')) die(); + +class helper_plugin_smtp extends DokuWiki_Plugin { + + /** + * Return info about supported methods in this Helper Plugin + * + * @return array of public methods + */ + public function getMethods() { + return array( + array( + 'name' => 'getThreads', + 'desc' => 'returns pages with discussion sections, sorted by recent comments', + 'params' => array( + 'namespace' => 'string', + 'number (optional)' => 'integer' + ), + 'return' => array('pages' => 'array') + ), + array( + // and more supported methods... + ) + ); + } + +} + +// vim:ts=4:sw=4:et: diff --git a/lang/en/lang.php b/lang/en/lang.php new file mode 100644 index 0000000..501a161 --- /dev/null +++ b/lang/en/lang.php @@ -0,0 +1,16 @@ + + */ + +// menu entry for admin plugins +// $lang['menu'] = 'Your menu entry'; + +// custom language strings for the plugin +// $lang['fixme'] = 'FIXME'; + + + +//Setup VIM: ex: et ts=4 : diff --git a/lang/en/settings.php b/lang/en/settings.php new file mode 100644 index 0000000..8c5b7c9 --- /dev/null +++ b/lang/en/settings.php @@ -0,0 +1,13 @@ + + */ + +// keys need to match the config setting name +// $lang['fixme'] = 'FIXME'; + + + +//Setup VIM: ex: et ts=4 : diff --git a/plugin.info.txt b/plugin.info.txt new file mode 100644 index 0000000..395400a --- /dev/null +++ b/plugin.info.txt @@ -0,0 +1,7 @@ +base smtp +author Andreas Gohr +email andi@splitbrain.org +date 2015-07-26 +name smtp plugin +desc Send mails via a configured SMTP server +url https://www.dokuwiki.org/plugin:smtp