Fix file always being set to 'schema.php'

When the name parameter is set and no custom file value is provided,
the name should be used to generate the file name. empty() cannot be
used because the file parameter has a default value of 'schema.php'.

Fixes #2202