Detect spaces in paths when using the XML/XSL writer #1077

Closed
mvriel opened this Issue Nov 20, 2013 · 4 comments

Comments

Projects
None yet
2 participants
@mvriel
Member

mvriel commented Nov 20, 2013

libxml does not look favourably on using spaces in target paths; to make this a controlled failure we will have to add a check when handling XML in a writer to fail if there is a space in the destination path

@mvriel

This comment has been minimized.

Show comment Hide comment
@mvriel

mvriel Dec 5, 2013

Member

This is an up-for-grabs item, meant to ease people new to phpDocumentor in contributing. The issue here is that the libxml does not work well with spaces in paths. At current there is not error handling to detect when there is a space in a path and as such that should be added.

There are three locations where XML is used:

  1. /src/phpDocumentor/Plugin/Core/Transformer/Writer/Xsl.php
  2. /src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php
  3. /src/phpDocumentor/Plugin/Core/Transformer/Writer/Checkstyle.php

These free files should receive a check that the provided path does not contain a space. If so an InvalidArgumentException should be thrown to indicate this erroneous state.

Member

mvriel commented Dec 5, 2013

This is an up-for-grabs item, meant to ease people new to phpDocumentor in contributing. The issue here is that the libxml does not work well with spaces in paths. At current there is not error handling to detect when there is a space in a path and as such that should be added.

There are three locations where XML is used:

  1. /src/phpDocumentor/Plugin/Core/Transformer/Writer/Xsl.php
  2. /src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php
  3. /src/phpDocumentor/Plugin/Core/Transformer/Writer/Checkstyle.php

These free files should receive a check that the provided path does not contain a space. If so an InvalidArgumentException should be thrown to indicate this erroneous state.

@mvriel mvriel modified the milestones: 2.4, 2.3 Feb 16, 2014

@mvriel mvriel modified the milestones: 2.5, 2.4 Mar 30, 2014

@choonge

This comment has been minimized.

Show comment Hide comment
@choonge

choonge May 2, 2014

Contributor

I'd like to give this one a try. I'm running phpdoc with --template=xml but am unsure what to look for - things seem to run correctly. Could you elaborate on the specific error?

Contributor

choonge commented May 2, 2014

I'd like to give this one a try. I'm running phpdoc with --template=xml but am unsure what to look for - things seem to run correctly. Could you elaborate on the specific error?

@mvriel

This comment has been minimized.

Show comment Hide comment
@mvriel

mvriel May 7, 2014

Member

Hi @choonge!

According to earlier bug reports (that I cannot find currently) and the FAQ page of Agavi (https://github.com/agavi/agavi/wiki/WTF#exception-configuration-file-cusersjoe-coolworkspaceagavi0110rc5srcroutingsoapwsdlxml-could-not-be-parsed-due-to-the-following-error-that-occured-while-resolving-xinclude-directives-line-3-failed-build-url-or-other-configuration-file-paths-especially-output_typesxml) a space in a path that is handled by XSL (thus when you use the responsive or new-black template) would cause a fatal error.

The same might happen when you create a template with a space in the folder name; that is expected to fail as well.

Does this help?

Member

mvriel commented May 7, 2014

Hi @choonge!

According to earlier bug reports (that I cannot find currently) and the FAQ page of Agavi (https://github.com/agavi/agavi/wiki/WTF#exception-configuration-file-cusersjoe-coolworkspaceagavi0110rc5srcroutingsoapwsdlxml-could-not-be-parsed-due-to-the-following-error-that-occured-while-resolving-xinclude-directives-line-3-failed-build-url-or-other-configuration-file-paths-especially-output_typesxml) a space in a path that is handled by XSL (thus when you use the responsive or new-black template) would cause a fatal error.

The same might happen when you create a template with a space in the folder name; that is expected to fail as well.

Does this help?

@mvriel mvriel modified the milestones: 2.6, 2.5, 2.7 May 17, 2014

@mvriel

This comment has been minimized.

Show comment Hide comment
@mvriel

mvriel Jul 9, 2014

Member

@siad007 has contributed a fix for this issue so I am going to close it; awesome!

Member

mvriel commented Jul 9, 2014

@siad007 has contributed a fix for this issue so I am going to close it; awesome!

@mvriel mvriel closed this Jul 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment