本文整理汇总了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')));
}
}