function cmis_common_cmisapi_invoke in CMIS API 7.2
Same name and namespace in other branches
- 6.4 cmis_common/cmis_common.module \cmis_common_cmisapi_invoke()
- 6.3 cmis_common/cmis_common.module \cmis_common_cmisapi_invoke()
- 7 cmis_common/cmis_common.module \cmis_common_cmisapi_invoke()
Implementation of hook_cmisapi_invoke().
File
- cmis_common/
cmis_common.module, line 79
Code
function cmis_common_cmisapi_invoke() {
$args = func_get_args();
$cmis_method = $args[0];
$repository_id = count($args) > 1 ? $args[1] : 'default';
unset($args[0]);
unset($args[1]);
$cmis_repository = cmis_get_repository($repository_id);
// pass repository info from cache
if ($cmis_method == 'getRepositoryInfo' && isset($cmis_repository->info)) {
return $cmis_repository->info;
}
// cache service instance
if (!isset($cmis_repository->service)) {
module_load_include('utils.inc', 'cmis_common');
// CommonCMISService allows other modules to control the way CMISService class
// calls the CMIS repositories via hook_cmis_invoke()
$cmis_repository->service = new CommonCMISService($cmis_repository->settings['url'], isset($cmis_repository->settings['user']), isset($cmis_repository->settings['password']));
}
return call_user_func_array(array(
$cmis_repository->service,
$cmis_method,
), $args);
}