I'm trying to work with Media Sources. I cannot find any documentation at all on how they actually work or how to work with them. The API docs are, as usual, somewhat less than helpful.
So far I have managed to get to this point, on suspicion that the source needs to be initialized before it can be used:
$mediasource = $modx->getObject('modMediaSource',array(
'name' => 'files' ));
$mediasource->initialize();
$sourceBasePath = $mediasource->getBasePath();
Now, according to the API, there are two functions that seem like they should provide a list of files and folders in the source, getObjectsInContainer( string $path ) and getContainerList( string $path ). However, all these do is return empty arrays instead of an array of files and folders, as expected.
So the question is, now that I have an initialized source and know its basePath, how do I go about getting a list of files and directories?