storecontents.php.svn-base
来自「PHP 知识管理系统(基于树结构的知识管理系统), 英文原版的PHP源码。」· SVN-BASE 代码 · 共 31 行
SVN-BASE
31 行
<?phprequire_once("../../config/dmsDefaults.php");require_once(KT_LIB_DIR . '/documentmanagement/documentutil.inc.php');require_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php');$sLocalname = KT_DIR . "/tests/document/dataset1/critique-of-pure-reason.txt";$sFilename = tempnam("/tmp", "kt_tests_document_add");copy($sLocalname, $sFilename);$oDocument =& Document::get(207);if (PEAR::isError($oDocument)) { print "FAILURE\n"; var_dump($oDocument);}$res = KTDocumentUtil::storeContents($oDocument, new KTFSFileLike($sFilename));if (PEAR::isError($res)) { print "FAILURE\n"; var_dump($res); exit(0);}// storeContents can update storage_path and also status id$oDocument->update();if (file_exists($sFilename)) { unlink($sFilename);}?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?