本文整理汇总了PHP中tar::addData方法的典型用法代码示例。如果您正苦于以下问题:PHP tar::addData方法的具体用法?PHP tar::addData怎么用?PHP tar::addData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tar
的用法示例。
在下文中一共展示了tar::addData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MakeWikiZip
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 '';
}
示例2: MakeWikiZip
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 '';
}
示例3: MakeWikiZip
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 '';
}
示例4: tar
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 '';
}
示例5: dump
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');
}
示例6: dump
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"], ''));
}