-
-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backslashes in output filenames #384
Comments
Thanks for mentioning this! We will investigate this as one of the top prio things! (can't have windows breaking can we ;)) |
It would be best to do an XSL replacement of the Since we are required to work with XSL 1.0 (which is a shame) a custom replace template needs to be added (as described here: http://geekswithblogs.net/Erik/archive/2008/04/01/120915.aspx) |
The generated filenames would also have to change, though I'm not sure if that should happen in phpDocumentor_Plugin_Core_Transformer_Writer_Xsl::transform() or phpDocumentor_Transformer::generateFilename() Regarding the XSL replacements, would it be easier passing in an extra variable into the stylesheet? (e.g. file_name as well as full_name) I'm not really familiar with the doxblox/phpDocumentor source code (or XSLT for that matter!) so I could be barking up the wrong tree here. |
You are definitely going in the right direction; the phpDocumentor_Plugin_Core_Transformer_Writer_Xsl writer needs to sanitize the 'artifact' (destination filename) and replace all illegal characters with dots. Since the 'artifact' for the XSL writer may contain a variable should this sanitation be done after the variable contents are injected. Regarding providing an additional filename: As such it is more versatile to generate the required filename from within the XSL template |
@mvriel Would the area to fix be in phpDocumentor_Transformer::generateFilename(), or somewhere else? |
@CloCkWeRX that is indeed the location + that the XSL templates need to transform the path. (currently the other templates generate their content in the output root folder; which is a problem if you are parsing a file called index.php because the output would be named index.html and thus overwrite the template's own index.html) |
I have altered the paths to use a . instead of namespace slashes |
phpDocumentor seems to include the backslash namespace delimiter in output filenames. For example, running it on a class with the following doc:
... Will produce "classes/db_\App_Test.html" in the output directory. This behavior can be confirmed by looking at some the filenames on http://demo.phpdoc.org/Responsive/
Filenames containing backslashes do not work on some platforms (e.g. Windows) so this really needs to be rectified in some way.
The text was updated successfully, but these errors were encountered: