本文整理匯總了PHP中repository::get_user_file_tree方法的典型用法代碼示例。如果您正苦於以下問題:PHP repository::get_user_file_tree方法的具體用法?PHP repository::get_user_file_tree怎麽用?PHP repository::get_user_file_tree使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類repository
的用法示例。
在下文中一共展示了repository::get_user_file_tree方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_listing
/**
*
* @global <type> $CFG
* @param <type> $encodedpath
* @param <type> $search
* @return <type>
*/
public function get_listing($encodedpath = '', $page = '', $search = '')
{
global $CFG;
try {
return repository::get_user_file_tree($search);
} catch (Exception $e) {
throw new repository_exception('emptyfilelist', 'repository_local');
}
}
示例2: getFileList
/**
* Retrieve file list for a user of the Moodle client calling this function
* @global <type> $DB
* @global <type> $USER
* @global <type> $MNET_REMOTE_CLIENT
* @global <type> $CFG
* @param <type> $username
* @param <type> $search
* @return <type>
*/
public function getFileList($username, $search)
{
global $DB, $USER, $MNET_REMOTE_CLIENT, $CFG;
///check the the user is known
///he has to be previously connected to the server site in order to be in the database
//TODO: this seems weird - is it executed from cron or what? Please review
$USER = $DB->get_record('user', array('username' => $username, 'mnethostid' => $MNET_REMOTE_CLIENT->id));
if (empty($USER)) {
exit(mnet_server_fault(9016, get_string('usernotfound', 'repository_remotemoodle', $username)));
}
try {
return repository::get_user_file_tree($search);
} catch (Exception $e) {
exit(mnet_server_fault(9016, get_string('failtoretrievelist', 'repository_remotemoodle')));
}
}