Example #1
0
 function MakeWikiZip($pExportFile)
 {
     global $gBitUser, $gBitSystem;
     include_once UTIL_PKG_PATH . "tar.class.php";
     $tar = new tar();
     $query = "SELECT wp.`page_id` from `" . BIT_DB_PREFIX . "wiki_pages` wp INNER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON (lc.`content_id` = wp.`content_id`) \n\t\t\t\t  ORDER BY lc." . $this->mDb->convertSortmode("title_asc");
     $result = $this->mDb->query($query, array());
     while ($res = $result->fetchRow()) {
         $page_id = $res["page_id"];
         $content = $this->export_wiki_page($page_id, 0);
         $tar->addData($page_id, $content, $gBitSystem->getUTCTime());
     }
     $tar->toTar($pExportFile, FALSE);
     return '';
 }
Example #2
0
 function MakeWikiZip()
 {
     global $tikidomain;
     $zipname = 'wikidb.zip';
     include_once 'lib/tar.class.php';
     $tar = new tar();
     $query = 'select `pageName` from `tiki_pages` order by ' . $this->convertSortMode('pageName_asc');
     $result = $this->query($query, array());
     while ($res = $result->fetchRow()) {
         $page = $res['pageName'];
         $content = $this->export_wiki_page($page, 0);
         $tar->addData($page, $content, $this->now);
     }
     $dump = 'dump';
     if ($tikidomain) {
         $dump .= "/{$tikidomain}";
     }
     $tar->toTar("{$dump}/export.tar", FALSE);
     return '';
 }
Example #3
0
 function MakeWikiZip()
 {
     global $tikidomain;
     $zipname = "wikidb.zip";
     include_once "lib/tar.class.php";
     $tar = new tar();
     $query = "select `pageName` from `tiki_pages` order by " . $this->convert_sortmode("pageName_asc");
     $result = $this->query($query, array());
     while ($res = $result->fetchRow()) {
         $page = $res["pageName"];
         $content = $this->export_wiki_page($page, 0);
         $tar->addData($page, $content, date("U"));
     }
     $dump = "dump";
     if ($tikidomain) {
         $dump .= "/{$tikidomain}";
     }
     $tar->toTar("{$dump}/export.tar", FALSE);
     return '';
 }
 function s_export_structure($structure_id)
 {
     global $exportlib, $tikidomain;
     global $dbTiki;
     include_once 'lib/wiki/exportlib.php';
     include_once 'lib/tar.class.php';
     $page_info = $this->s_get_structure_info($structure_id);
     $page_name = $page_info['pageName'];
     $zipname = $page_name . '.zip';
     $tar = new tar();
     $pages = $this->s_get_structure_pages($page_info['page_ref_id']);
     foreach ($pages as $page) {
         $data = $exportlib->export_wiki_page($page['pageName'], 0);
         $tar->addData($page['pageName'], $data, $this->now);
     }
     $dump = 'dump';
     if ($tikidomain) {
         $dump .= "/{$tikidomain}";
     }
     $tar->toTar("{$dump}/{$page_name}.tar", FALSE);
     header("location: {$dump}/{$page_name}.tar");
     return '';
 }
Example #5
0
 function dump()
 {
     global $tikidomain, $prefs;
     $parserlib = TikiLib::lib('parser');
     $dump_path = "dump";
     if ($tikidomain) {
         $dump_path .= "/{$tikidomain}";
     }
     @unlink("{$dump_path}/new.tar");
     $tar = new tar();
     $tar->addFile('styles/' . $prefs['style']);
     // Foreach page
     $query = "select * from `tiki_pages`";
     $result = $this->query($query, array());
     while ($res = $result->fetchRow()) {
         $pageName = $res["pageName"] . '.html';
         $dat = $parserlib->parse_data($res["data"]);
         // Now change index.php?page=foo to foo.html
         // and index.php to HomePage.html
         $dat = preg_replace("/tiki-index.php\\?page=([^\\'\"\$]+)/", "\$1.html", $dat);
         $dat = preg_replace("/tiki-editpage.php\\?page=([^\\'\"\$]+)/", "", $dat);
         //preg_match_all("/tiki-index.php\?page=([^ ]+)/",$dat,$cosas);
         //print_r($cosas);
         $data = "<html><head><title>" . $res["pageName"] . "</title><link rel='StyleSheet' href='styles/" . $prefs['style'] . "' type='text/css'></head><body><a class='wiki' href='" . $prefs['wikiHomePage'] . ".html'>home</a><br /><h1>" . $res["pageName"] . "</h1><div class='wikitext'>" . $dat . '</div></body></html>';
         $tar->addData($pageName, $data, $res["lastModif"]);
     }
     $tar->toTar("{$dump_path}/new.tar", FALSE);
     unset($tar);
     $logslib = TikiLib::lib('logs');
     $logslib->add_log('dump', 'dump created');
 }
Example #6
0
 function dump()
 {
     global $tikidomain, $wikiHomePage, $style;
     $dump_path = "dump";
     if ($tikidomain) {
         $dump_path .= "/{$tikidomain}";
     }
     @unlink("{$dump_path}/new.tar");
     $tar = new tar();
     $tar->addFile("styles/{$style}");
     // Foreach page
     $query = "select * from `tiki_pages`";
     $result = $this->query($query, array());
     while ($res = $result->fetchRow()) {
         $pageName = $res["pageName"] . '.html';
         $dat = $this->parse_data($res["data"]);
         // Now change index.php?page=foo to foo.html
         // and index.php to HomePage.html
         $dat = preg_replace("/tiki-index.php\\?page=([^\\'\"\$]+)/", "\$1.html", $dat);
         $dat = preg_replace("/tiki-editpage.php\\?page=([^\\'\"\$]+)/", "", $dat);
         //preg_match_all("/tiki-index.php\?page=([^ ]+)/",$dat,$cosas);
         //print_r($cosas);
         $data = "<html><head><title>" . $res["pageName"] . "</title><link rel='StyleSheet' href='styles/{$style}' type='text/css'></head><body><a class='wiki' href='{$wikiHomePage}.html'>home</a><br /><h1>" . $res["pageName"] . "</h1><div class='wikitext'>" . $dat . '</div></body></html>';
         $tar->addData($pageName, $data, $res["lastModif"]);
     }
     $tar->toTar("{$dump_path}/new.tar", FALSE);
     unset($tar);
     $action = "dump created";
     $t = date("U");
     $query = "insert into `tiki_actionlog`(`action`,`pageName`,`lastModif`,`user`,`ip`,`comment`) values(?,?,?,?,?,?)";
     $result = $this->query($query, array($action, $wikiHomePage, $t, 'admin', $_SERVER["REMOTE_ADDR"], ''));
 }