$incubatorChapters = array();
$soap = new SoapClient($confluenceWsdl);
$ver = 0.1;
$chapters = array();
$incubatorChapters = array();
if ($language == 'en') {
    $incubatorFile = file_get_contents($manualIncPath . 'manual.xml');
    $incubatorFile = preg_replace('/(<!--.*-->)/isU', '', $incubatorFile);
    $incubatorFile = preg_replace_callback('/(&module_specs.)(.+)(;)/', 'processIncubatorChapters', $incubatorFile);
    $isxml = @simplexml_load_string($incubatorFile);
    foreach ($isxml->chapter as $key => $chapter) {
        array_push($incubatorChapters, $chapter);
    }
}
$token = $soap->login($confluenceUser, $confluencePass);
$currentPages = $soap->getPages($token, $confluenceSpace);
foreach ($currentPages as $key => $page) {
    array_push($oldwikiPages, $page->title);
}
if (count($incubatorChapters)) {
    $chapters = array_merge($chapters, $incubatorChapters);
}
$homePage = $soap->getPage($token, $confluenceSpace, 'Home');
$autoId = 0;
foreach ($chapters as $key => $chapter) {
    $autoId++;
    $filename = $chapter['id'];
    echo $autoId . '. ' . $chapter->title . "\n";
    $mytmp = $chapter->sect1[0]->asXML();
    $mytmp = cleanup($mytmp);
    $xml = new DOMDocument();
    echo 'does not exist - creating';
    $page = new stdClass();
    $page->id = false;
    $page->version = 1;
    $page->permissions = true;
    $page->current = true;
    $page->homePage = false;
    $page->space = $space;
    $page->title = 'Appendix';
    $page->content = '{children}';
    $page->parentId = false;
    $soap->storePage($token, $page);
    $appendix = $soap->getPage($token, $space, 'Appendix');
    array_push($new, 'Appendix');
}
$current = $soap->getPages($token, $space);
echo "\nQuerying current wiki pages: ";
foreach ($current as $key => $wikiPage) {
    $key = md5($wikiPage->parentId . trim(substr($wikiPage->title, strpos($wikiPage->title, '. ') + 2)));
    $compare[$key] = $wikiPage;
    echo "\n\n\t title: " . $wikiPage->title;
    echo "\n\t hash: " . $key;
    array_push($prev, $wikiPage->title);
}
// process chapters
$i = 0;
foreach ($book->chapter as $chapter) {
    $i++;
    $mainChapter = new Confluence_Chapter($chapter, $i . '. ');
    $subChapter = new Confluence_Chapter($chapter->sect1[0], $i . '. ');
    $compareKey = md5($home->id . $mainChapter->getTitle(false));
Example #3
0
<?php 
require_once 'includes/header.php';
require_once 'etc/config.php';
$soap = new SoapClient($confluenceWsdl);
$token = $soap->login($confluenceUser, $confluencePass);
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (is_array($_POST['page'])) {
        foreach ($_POST['page'] as $key => $pageId) {
            $soap->removePage($token, $pageId);
        }
    }
}
$pages = $soap->getPages($token, $_REQUEST['space']);
arsort($pages);
?>

<h1>Zend Framework - Wiki Page Manager</h1>
<p>Currently browsing <?php 
echo $_REQUEST['space'];
?>
</p>
<form name="frm_page_manager" method="post" action="pages.php">
<table width="100%">
  <tr>
    <th>x</th>
    <th>id</th>
    <th>parent id</th>
    <th>page</th>
  </tr>
<?php 
foreach ($pages as $key => $page) {