Skip to content

Commit ea5bd6e

Browse files
update to 2018-10-12
1 parent 2b08042 commit ea5bd6e

File tree

5 files changed

+73
-15
lines changed

5 files changed

+73
-15
lines changed

.travis.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: php
2+
3+
matrix:
4+
include:
5+
- php: "7.2"
6+
env: DOKUWIKI=master
7+
- php: "7.2"
8+
env: DOKUWIKI=release_stable_2018-04-22a
9+
- php: "7.1"
10+
env: DOKUWIKI=master
11+
- php: "7.1"
12+
env: DOKUWIKI=release_stable_2018-04-22a
13+
- php: "7.0"
14+
env: DOKUWIKI=master
15+
- php: "7.0"
16+
env: DOKUWIKI=release_stable_2018-04-22a
17+
- php: "5.6"
18+
env: DOKUWIKI=master
19+
- php: "5.6"
20+
env: DOKUWIKI=release_stable_2018-04-22a
21+
- php: "5.6"
22+
env: DOKUWIKI=release_stable_2017-02-19e
23+
- php: "5.6"
24+
env: DOKUWIKI=release_stable_2016-06-26e
25+
- php: "5.6"
26+
env: DOKUWIKI=release_stable_2015-08-10a
27+
28+
before_install: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/travis.sh
29+
install: sh travis.sh
30+
script:
31+
- cd _test
32+
- phpunit --group plugin_textrotate

_test/syntax.test.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/**
3+
* @group plugin_textrotate
4+
* @group plugins
5+
*/
6+
class plugin_textrotate_syntax_test extends DokuWikiTest {
7+
8+
protected $pluginsEnabled = array(
9+
'textrotate'
10+
);
11+
public function setup() {
12+
parent::setup();
13+
$this->_createPages();
14+
}
15+
16+
17+
public function test_basic_syntax() {
18+
$xhtml = p_wiki_xhtml('test:plugin_textrotate');
19+
$doc = phpQuery::newDocument($xhtml);
20+
21+
$img = pq('img',$doc);
22+
23+
echo $doc;
24+
25+
}
26+
27+
protected function _createPages() {
28+
saveWikiText('test:plugin_textrotate', '!!textrotate!!', 'test');
29+
30+
}
31+
}

action.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,23 @@
77
*/
88

99
if (!defined('DOKU_INC')) die();
10-
if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
11-
require_once (DOKU_PLUGIN . 'action.php');
1210

1311
class action_plugin_textrotate extends DokuWiki_Action_Plugin {
1412
/**
1513
* Register the eventhandlers
1614
*/
1715
function register(Doku_Event_Handler $controller) {
1816
$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ());
17+
18+
if(!function_exists('ImageCreate')) {
19+
msg('plugin textrotate: install image php-gd package', -1, '', '', MSG_ADMINS_ONLY);
20+
}
1921
}
2022

2123
/**
2224
* Inserts the toolbar button
2325
*/
24-
function insert_button(&$event, $param) {
26+
function insert_button(Doku_Event $event, $param) {
2527
$event->data[] = array(
2628
'type' => 'format',
2729
'title' => 'Vertikaler Text generieren',

plugin.info.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
base textrotate
2-
author lisps
3-
email
4-
date 2013-10-25
2+
author lisps, peterfromearth
3+
4+
date 2018-10-12
55
name TextRotate Plugin
66
desc converts a string into an image and rotates it
77
url http://dokuwiki.org/plugin:textrotate

syntax.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@
55
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
66
* @author lisps
77
*/
8-
9-
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
10-
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
11-
require_once(DOKU_PLUGIN.'syntax.php');
12-
if (!defined('DOKU_LF')) define('DOKU_LF', "\n");
13-
if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t");
14-
if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
15-
8+
if (!defined('DOKU_INC')) die();
169
/*
1710
* All DokuWiki plugins to extend the parser/rendering mechanism
1811
* need to inherit from this class
@@ -95,7 +88,7 @@ function render($mode, Doku_Renderer $renderer, $data)
9588
$file = $basedir.'/'. $img_name .'.png';
9689

9790
if(!file_exists($file)||true) {
98-
@mkdir($basedir,777,true);
91+
@mkdir($basedir,755,true);
9992

10093
$width = 15;
10194
$height = strlen($text)*10;

0 commit comments

Comments
 (0)