本文整理匯總了PHP中DocumentManager::documentExists方法的典型用法代碼示例。如果您正苦於以下問題:PHP DocumentManager::documentExists方法的具體用法?PHP DocumentManager::documentExists怎麽用?PHP DocumentManager::documentExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DocumentManager
的用法示例。
在下文中一共展示了DocumentManager::documentExists方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: document_exists
/**
* Check if a document width the chosen filename already exists
*/
function document_exists($filename)
{
global $dir;
// Clean up the name, only ASCII characters should stay. (and strict)
$cleanName = replace_dangerous_char($filename, 'strict');
// No "dangerous" files
$cleanName = disable_dangerous_file($cleanName);
return !DocumentManager::documentExists($dir . $cleanName . '.html', api_get_course_info(), api_get_session_id(), api_get_group_id());
/*$filename = addslashes(trim($filename));
$filename = Security::remove_XSS($filename);
$filename = replace_dangerous_char($filename);
$filename = disable_dangerous_file($filename);
return !file_exists($filepath.$filename.'.html');*/
}
示例2: document_exists
/**
* Check if a document width the chosen filename already exists
*/
function document_exists($filename)
{
global $dir;
$cleanName = api_replace_dangerous_char($filename);
// No "dangerous" files
$cleanName = disable_dangerous_file($cleanName);
return !DocumentManager::documentExists($dir . $cleanName . '.html', api_get_course_info(), api_get_session_id(), api_get_group_id());
}