我有一个插件,可以将一些文件传输到安装该插件的站点的上传文件夹。
它工作正常,但图像不会显示在媒体管理器中。我希望涉及一些数据库注册。
考虑到下面的脚本将文件复制到目录中,我需要向循环中添加什么命令来为media manager注册每个图像?
foreach(new RecursiveIteratorIterator($rdi) as $files)
{
if ($files->isFile())
{
$imagepath = $files->getRealPath();
$image = basename($files->getPathname());
copy($imagepath, $my_target_folder.\'/\'.$image);
}
}