本文整理匯總了PHP中IO::getFileContent方法的典型用法代碼示例。如果您正苦於以下問題:PHP IO::getFileContent方法的具體用法?PHP IO::getFileContent怎麽用?PHP IO::getFileContent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IO
的用法示例。
在下文中一共展示了IO::getFileContent方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getDzzPath
//版本比較模式,顯示當前版本與前一版本的差異
$current = $versions[$version];
if (isset($versions[$version])) {
$dzzpath = getDzzPath($versions[$version]);
$str_new = str_replace(array("\r\n", "\r", "\n"), "", IO::getFileContent($dzzpath));
} else {
$dzzpath = getDzzPath($document);
$str_new = str_replace(array("\r\n", "\r", "\n"), "", IO::getFileContent($dzzpath));
}
if ($versions[$version - 1]) {
$dzzpath_old = getDzzPath($versions[$version - 1]);
$str_old = str_replace(array("\r\n", "\r", "\n"), "", IO::getFileContent($dzzpath_old));
} else {
$str_old = $str_new;
}
include_once dzz_libfile('class/html_diff', 'document');
$diff = new html_diff();
$str = $diff->compare($str_old, $str_new);
} else {
$current = $document;
$dzzpath = getDzzPath($document);
$str = str_replace(array("\r\n", "\r", "\n"), "", IO::getFileContent($dzzpath));
$navtitle = $document['subject'];
}
} else {
showmessage('文檔不存在或已經刪除', dreferer());
}
$dicoid = dzzencode($icoid);
$editperm = perm_check::checkperm('edit', $icoarr);
include template('document_view');
}
示例2: exit
<?php
/*
* @copyright Leyun internet Technology(Shanghai)Co.,Ltd
* @license http://www.dzzoffice.com/licenses/license.txt
* @package DzzOffice
* @link http://www.dzzoffice.com
* @author zyx(zyx@dzz.cc)
*/
if (!defined('IN_DZZ')) {
exit('Access Denied');
}
$path = dzzdecode($_GET['path']);
$str = IO::getFileContent($path);
require_once DZZ_ROOT . './dzz/class/class_encode.php';
$p = new Encode_Core();
$code = $p->get_encoding($str);
if ($code) {
$str = diconv($str, $code, CHARSET);
}
$str = htmlspecialchars($str);
$str = nl2br(str_replace(array("\t", ' ', ' '), array(' ', ' ', ' '), $str));
include template('textviewer');
示例3: array
$return = array('did' => $did, 'autosave' => $autosave, 'icoid' => dzzencode($icoid));
showmessage('do_success', dreferer(), array('data' => rawurlencode(json_encode($return))), array('showmsg' => true));
} else {
$navtitle = '';
$icoid = intval(dzzdecode($_GET['icoid']));
if ($icoid && ($icoarr = C::t('icos')->fetch_by_icoid($icoid))) {
if (!perm_check::checkperm('edit', $icoarr)) {
showmessage('no_privilege');
}
$did = $icoarr['did'];
} else {
showmessage('文檔不存在');
}
if ($document = C::t('document')->fetch_by_did($did)) {
$dzzpath = getDzzPath($document);
$str = trim(IO::getFileContent($dzzpath));
$navtitle = $document['subject'];
} else {
$navtitle = '新建文檔';
}
include template('document_edit');
}
function getAidsByMessage($message)
{
$aids = array();
if (preg_match_all("/" . rawurlencode('attach::') . "(\\d+)/i", $message, $matches)) {
$aids = $matches[1];
}
if (preg_match_all("/path=\"attach::(\\d+)\"/i", $message, $matches1)) {
if ($matches1[1]) {
$aids = array_merge($aids, $matches1[1]);
示例4: getDzzPath
$dzzpath = getDzzPath($versions[$version]);
$str_new = IO::getFileContent($dzzpath);
//str_replace(array("\r\n", "\r", "\n"), "",io::getFileContent($dzzpath));
} else {
$dzzpath = getDzzPath($document);
$str_new = IO::getFileContent($dzzpath);
//str_replace(array("\r\n", "\r", "\n"), "",io::getFileContent($dzzpath));
}
if ($versions[$version - 1]) {
$dzzpath_old = getDzzPath($versions[$version - 1]);
$str_old = IO::getFileContent($dzzpath_old);
//str_replace(array("\r\n", "\r", "\n"), "",io::getFileContent($dzzpath_old));
} else {
$str_old = $str_new;
}
include_once dzz_libfile('class/html_diff', 'document');
$diff = new html_diff();
$str = $diff->compare($str_old, $str_new);
} else {
$current = $document;
$dzzpath = getDzzPath($document);
$str = IO::getFileContent($dzzpath);
//str_replace(array("\r\n", "\r", "\n"), "",IO::getFileContent($dzzpath));
$navtitle = $document['subject'];
}
} else {
$document = $class;
$document['subject'] = $class['fname'];
$document['dateline'] = dgmdate($document['dateline'], 'u');
}
include template('list/view');
示例5: exit
} else {
C::t('document')->delete_by_did($newdid, true);
exit(json_encode(array('error' => '文檔導入失敗')));
}
} else {
C::t('corpus_class')->delete_by_fid($fid, true);
exit(json_encode(array('error' => '文檔導入失敗')));
}
} elseif ($aid > 0) {
//文本類文檔;
if (!($attach = C::t('attachment')->fetch($aid))) {
C::t('corpus_class')->delete_by_fid($fid, true);
exit(json_encode(array('error' => '文檔導入失敗')));
}
$path = getDzzPath($attach);
$message = IO::getFileContent($path);
require_once DZZ_ROOT . './dzz/class/class_encode.php';
$p = new Encode_Core();
$code = $p->get_encoding($message);
if ($code) {
$message = diconv($message, $code, CHARSET);
}
$message = htmlspecialchars($message);
$message = nl2br(str_replace(array("\t", ' ', ' '), array(' ', ' ', ' '), $message));
if (!($attach = getTxtAttachByMd5($message, $setarr['fname'] . '.dzzdoc'))) {
C::t('corpus_class')->delete_by_fid($fid, true);
exit(json_encode(array('error' => '文檔導入失敗')));
}
$setarr1 = array('uid' => $_G['uid'], 'username' => $_G['username'], 'aid' => $attach['aid'], 'fid' => $fid);
if (!($newdid = C::t('document')->insert($setarr1, array(), 'corpus', $cid))) {
C::t('corpus_class')->delete_by_fid($fid, true);
示例6: topshowmessage
}
}
if (!preg_match("/^(http|ftp|https|mms)\\:\\/\\/.{4,300}\$/i", $link)) {
topshowmessage('網址格式錯誤!');
}
$icoarr = io_dzz::linktourl($link, $pfid);
} elseif ($_GET['type'] == 'dzzdoc') {
$aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
$attach = C::t('attachment')->fetch($aid);
if (!$attach) {
topshowmessage(lang('message', 'attachment_nonexistence'));
}
if (!empty($_GET['filename'])) {
$attach['filename'] = trim($_GET['filename']);
}
$icoarr = IO::upload_by_content(IO::getFileContent('attach::' . $attach['aid']), $pfid, trim($attach['filename'], '.dzzdoc') . '.dzzdoc');
} else {
$aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
$attach = C::t('attachment')->fetch($aid);
if (!$attach) {
topshowmessage(lang('message', 'attachment_nonexistence'));
}
if (!empty($_GET['filename'])) {
$attach['filename'] = trim($_GET['filename']);
}
$icoarr = io_dzz::uploadToattachment($attach, $pfid);
}
if (isset($icoarr['error'])) {
topshowmessage($icoarr['error']);
}
include template('common/header_simple');