public function accept()
{
$info = parent::current();
if (!isset($info['name']) || !is_string($info['name'])) {
return false;
}
// Reject names with "$" characters (e.g. indexes, oplog)
if (strpos($info['name'], '$') !== false) {
return false;
}
$firstDot = strpos($info['name'], '.');
/* Legacy collection names are a namespace and should be prefixed with
* the database name and a dot. Reject values that omit this prefix or
* are empty beyond it.
*/
if ($firstDot === false || $firstDot + 1 == strlen($info['name'])) {
return false;
}
return true;
}