I've got a plugin that transfers some files over to the uploads folder of the site in which the plugin is installed.
It works fine, however, the images are not appearing in the Media Manager. I expect some database registration is involved.
Given the script below which copies the files into the directory, what command would I need to add to the loop to register each image for the media manager?
foreach(new RecursiveIteratorIterator($rdi) as $files)
{
if ($files->isFile())
{
$imagepath = $files->getRealPath();
$image = basename($files->getPathname());
copy($imagepath, $my_target_folder.'/'.$image);
}
}