當前位置: 首頁>>代碼示例>>PHP>>正文


PHP tar::addData方法代碼示例

本文整理匯總了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 '';
 }
開發者ID:bitweaver,項目名稱:wiki,代碼行數:15,代碼來源:export_lib.php

示例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 '';
 }
開發者ID:rjsmelo,項目名稱:tiki,代碼行數:20,代碼來源:exportlib.php

示例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 '';
 }
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:20,代碼來源:exportlib.php

示例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 '';
 }
開發者ID:Kraiany,項目名稱:kraiany_site_docker,代碼行數:23,代碼來源:structlib.php

示例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');
 }
開發者ID:linuxwhy,項目名稱:tiki-1,代碼行數:31,代碼來源:adminlib.php

示例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"], ''));
 }
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:32,代碼來源:adminlib.php


注:本文中的tar::addData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。