当前位置: 首页>>代码示例>>PHP>>正文


PHP saveWikiText函数代码示例

本文整理汇总了PHP中saveWikiText函数的典型用法代码示例。如果您正苦于以下问题:PHP saveWikiText函数的具体用法?PHP saveWikiText怎么用?PHP saveWikiText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了saveWikiText函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_sort

 public function test_sort()
 {
     saveWikiText('title1', 'test', 'test');
     $title = new Title('title1');
     $title->setTitle('This is a title');
     saveWikiText('title2', 'test', 'test');
     $title = new Title('title2');
     $title->setTitle('This is a title');
     saveWikiText('title3', 'test', 'test');
     $title = new Title('title3');
     $title->setTitle('Another Title');
     $this->loadSchemaJSON('pageschema');
     $this->saveData('test1', 'pageschema', array('singletitle' => 'title1'));
     $this->saveData('test2', 'pageschema', array('singletitle' => 'title2'));
     $this->saveData('test3', 'pageschema', array('singletitle' => 'title3'));
     $search = new Search();
     $search->addSchema('pageschema');
     $search->addColumn('%pageid%');
     $search->addColumn('singletitle');
     $search->addSort('singletitle', true);
     /** @var Value[][] $result */
     $result = $search->execute();
     $this->assertEquals(3, count($result));
     $this->assertEquals('test3', $result[0][0]->getValue());
     $this->assertEquals('test1', $result[1][0]->getValue());
     $this->assertEquals('test2', $result[2][0]->getValue());
 }
开发者ID:cosmocode,项目名称:dokuwiki-plugin-struct,代码行数:27,代码来源:Type_Page.test.php

示例2: test_p_set_metadata_during_rendering

 function test_p_set_metadata_during_rendering()
 {
     global $EVENT_HANDLER;
     $this->id = 'test:p_set_metadata_during_rendering';
     $this->active = true;
     // write the wiki page so it exists and needs to be rendered
     saveWikiText($this->id, 'Test ' . time(), 'Test data setup');
     $EVENT_HANDLER->register_hook('PARSER_METADATA_RENDER', 'BEFORE', $this, 'helper_set_metadata', array('test_before_set' => 'test'));
     $EVENT_HANDLER->register_hook('PARSER_METADATA_RENDER', 'AFTER', $this, 'helper_set_metadata', array('test_after_set' => 'test'));
     $EVENT_HANDLER->register_hook('PARSER_HANDLER_DONE', 'BEFORE', $this, 'helper_inject_test_instruction');
     // Change the global plugin controller so this test can be a fake syntax plugin
     global $plugin_controller;
     $this->plugin_controller = $plugin_controller;
     $plugin_controller = $this;
     // the actual rendering, all hooks should be executed here
     $newMeta = p_get_metadata($this->id);
     // restore the plugin controller
     $plugin_controller = $this->plugin_controller;
     // assert that all three calls to p_set_metadata have been successful
     $this->assertEqual($newMeta['test_before_set'], 'test');
     $this->assertEqual($newMeta['test_after_set'], 'test');
     $this->assertEqual($newMeta['test_during_rendering'], 'test');
     // clean up
     $this->active = false;
     // make sure the saved metadata is the one that has been rendered
     $this->assertEqual($newMeta, p_get_metadata($this->id));
     saveWikiText($this->id, '', 'Test data remove');
 }
开发者ID:rezlemic,项目名称:dokuwiki-jQuery,代码行数:28,代码来源:parserutils_set_metadata_during_rendering.test.php

示例3: test_parameters

 function test_parameters()
 {
     saveWikiText('test:links', '[[wiki:syntax?do=export_raw]] [[:web:scripts:add_vhost.sh?do=export_raw]]', 'Init tests');
     idx_addPage('test:links');
     $this->assertEquals(array('test:links'), ft_backlinks('wiki:syntax'));
     $this->assertEquals(array('test:links'), ft_backlinks('web:scripts:add_vhost.sh'));
 }
开发者ID:richmahn,项目名称:Door43,代码行数:7,代码来源:fulltext_backlinks.test.php

示例4: handle_approve

 function handle_approve(&$event, $param)
 {
     global $ID, $REV;
     if (!$this->can_approve()) {
         return;
     }
     if ($event->data == 'show' && isset($_GET['approve'])) {
         //Add or remove the new line from the end of the page. Silly but needed.
         $content = rawWiki($ID, '');
         if (substr($content, -1) == "\n") {
             $content = substr($content, 0, -1);
         } else {
             $content .= "\n";
         }
         saveWikiText($ID, $content, APPROVED);
         header('Location: ?id=' . $ID);
     }
     /*czytacze wydzą najnowszą zatwierdzaną*/
     $last = $this->find_lastest_approved();
     /*użytkownik może tylko czytać i jednocześnie istnieje jakaś zatwierdzona strona*/
     if (auth_quickaclcheck($ID) <= AUTH_READ && $last != -1) {
         /*najnowsza zatwierdzona nie jest najnowszą*/
         /*i jednocześnie znajdujemy się w stronach nowszych niż aktualna zatwierdzona*/
         if ($last != 0 && ($REV > $last || $REV == 0)) {
             $REV = $last;
         }
     }
 }
开发者ID:sawachan,项目名称:dokuwiki-plugin-approve,代码行数:28,代码来源:approve.php

示例5: test_media_in_deleted_pages

 public function test_media_in_deleted_pages()
 {
     saveWikiText('test:internalmedia_usage', '{{internalmedia.png}} {{..:internal media.png}}', 'Test initialization');
     idx_addPage('test:internalmedia_usage');
     saveWikiText('test:internalmedia_usage', '', 'Deleted');
     $this->assertEquals(array(), ft_mediause('internal_media.png'));
     $this->assertEquals(array(), ft_mediause('test:internalmedia.png'));
 }
开发者ID:richmahn,项目名称:Door43,代码行数:8,代码来源:fulltext_mediause.test.php

示例6: setUp

 public function setUp()
 {
     parent::setUp();
     saveWikiText('testpage', 'Foo bar baz.', 'Test initialization');
     saveWikiText('notfound', 'Foon barn bazn.', 'Test initialization');
     idx_addPage('testpage');
     idx_addPage('notfound');
 }
开发者ID:richmahn,项目名称:Door43,代码行数:8,代码来源:indexer_indexing.test.php

示例7: setUp

 /**
  * Create some page namespace structure
  */
 function setUp()
 {
     $pages = array('animals:mammals:bear:brownbear', 'animals:mammals:bear:blackbear', 'animals:mammals:cute:otter', 'animals:mammals:cute:cat', 'animals:mammals:cute:dog', 'animals:insects:butterfly:fly', 'animals:insects:butterfly:moth', 'animals:monkey', 'humans:programmers:andi', 'humans:programmers:joe', 'humans:programmers:john', 'yeti');
     foreach ($pages as $page) {
         saveWikiText($page, $page, 'test setup');
     }
     parent::setUp();
 }
开发者ID:kochichi,项目名称:dokuwiki-plugin-move,代码行数:11,代码来源:plan.test.php

示例8: test_no_aprroved_banner

 /**
  * @coversNothing
  */
 public function test_no_aprroved_banner()
 {
     global $conf;
     $conf['plugin']['publish']['hide_approved_banner'] = 1;
     saveWikiText('foo', 'bar', 'foobar');
     $request = new TestRequest();
     $response = $request->get(array(), '/doku.php?id=foo&publish_approve=1');
     $this->assertTrue(strpos($response->getContent(), '<div class="approval') === false, 'The approved banner is still showing even so it is supposed not to show.');
 }
开发者ID:hefanbo,项目名称:dokuwiki-plugin-publish,代码行数:12,代码来源:publish.test.php

示例9: test_relation_references_without_link

 public function test_relation_references_without_link()
 {
     $text = "My page without a link.";
     $id = "source";
     saveWikiText($id, $text, 'Created');
     self::assertEquals(null, p_get_metadata($id, 'relation references', METADATA_RENDER_UNLIMITED));
     $text .= DOKU_LF . "~~META:relation references=foo~~";
     saveWikiText($id, $text, 'Updated');
     self::assertEquals(array('foo' => false), p_get_metadata($id, 'relation references', METADATA_RENDER_UNLIMITED));
 }
开发者ID:ilkkatoje,项目名称:plugin-meta,代码行数:10,代码来源:rendering.test.php

示例10: test_media_in_footnotes

    public function test_media_in_footnotes() {
        saveWikiText('test:media_footnotes', '(({{footnote.png?20x50}} [[foonote|{{:footlink.png}}]]))', 'Test initialization');
        idx_addPage('test:media_footnotes');

        $query = array('test:footnote.png', 'footlink.png');
        $this->assertEquals(array(
            'test:footnote.png' => array('test:media_footnotes'),
            'footlink.png' => array('test:media_footnotes')
        ), idx_get_indexer()->lookupKey('relation_media', $query));
    }
开发者ID:neutrinog,项目名称:Door43,代码行数:10,代码来源:mediaindex.test.php

示例11: setUp

 public function setUp()
 {
     parent::setUp();
     saveWikiText('foo', "====== Page-Heading ======", 'summary');
     $req = new TestRequest();
     $req->get(array(), '/doku.php?id=foo');
     saveWikiText('testpage', "---- dataentry Testentry ----\n" . "test1_title: foo|bar\n" . "----\n", 'summary');
     //trigger save to db
     $req = new TestRequest();
     $req->get(array(), '/doku.php?id=testpage');
 }
开发者ID:RnBConsulting,项目名称:dokuwiki-plugin-data,代码行数:11,代码来源:db.test.php

示例12: test_PageLockedByYou

 public function test_PageLockedByYou()
 {
     $page_id = 'test:main';
     $GLOBALS['INPUT']->server->set('REMOTE_USER', 'testuser');
     saveWikiText($page_id, 'some text', 'some summary');
     lock($page_id);
     $json = $this->doCall($page_id, null, 'testuser');
     $this->assertInstanceOf('\\stdClass', $json);
     $this->assertObjectHasAttribute('error', $json);
     $this->assertRegExp("/^\\d{2}:\\d{2}:\\d{2} Page is locked by You. You cannot delete page during edit.\$/", $json->error);
 }
开发者ID:yurii-github,项目名称:dokuwiki-plugin-yktools,代码行数:11,代码来源:CheckPage.php

示例13: setUp

 public function setUp()
 {
     $this->pluginsEnabled[] = 'tag';
     parent::setUp();
     saveWikiText('tagged_page', '{{tag>mytag test2tag}}', 'Test');
     saveWikiText('negative_page', '{{tag>negative_tag mytag}}', 'Test setup');
     saveWikiText('third_page', '{{tag>third_tag}}', 'Test setup');
     idx_addPage('tagged_page');
     idx_addPage('negative_page');
     idx_addPage('third_page');
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:11,代码来源:topic_and_tagrefine.test.php

示例14: setUp

 public function setUp()
 {
     global $conf;
     $this->pluginsEnabled[] = 'tag';
     parent::setUp();
     $conf['plugin']['tag']['sortkey'] = 'ns';
     $this->helper = plugin_load('helper', 'tag');
     foreach ($this->pages as $page) {
         saveWikiText($page, '{{tag>mytag}}', 'Test');
         idx_addPage($page);
     }
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:12,代码来源:topic_sort.test.php

示例15: test_renameOkay

 /**
  * @covers action_plugin_move_rename::renameOkay
  */
 function test_renameOkay()
 {
     global $conf;
     global $USERINFO;
     $conf['superuser'] = 'john';
     $_SERVER['REMOTE_USER'] = 'john';
     $USERINFO['grps'] = array('admin', 'user');
     saveWikiText('wiki:foo:start', '[[..:..:one_ns_up:]]', 'Test setup');
     idx_addPage('wiki:foo:start');
     $move_rename = new action_plugin_move_rename();
     $this->assertTrue($move_rename->renameOkay('wiki:foo:start'));
 }
开发者ID:kochichi,项目名称:dokuwiki-plugin-move,代码行数:15,代码来源:tpl.test.php


注:本文中的saveWikiText函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。