Skip to content
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

Update phpdoc.dist.xml loading issue #1380

Merged
merged 3 commits into from Aug 1, 2014

Conversation

shulard
Copy link
Contributor

@shulard shulard commented Aug 1, 2014

When ran phpdoc without parameters it can't load phpdoc.dist.xml directly and show a "No parsable files were found" Exception.
Change userConfig file path search to take dist even if the user do not give a specific parameter.

When ran phpdoc without parameters it can't load phpdoc.dist.xml directly and show a "No parsable files were found" Exception.
Change userConfig file path search to take dist even if the user do not give a specific parameter.

Signed-off-by: Stéphane HULARD <s.hulard@chstudio.fr>
@@ -110,9 +110,9 @@ private function isValidFile($path)
private function createConfigurationObject($templatePath, $defaultUserConfigPath, $customUserConfigPath, $class)
{
$config = $this->serializer->deserialize(file_get_contents($templatePath), $class, 'xml');
$customUserConfigPath = $customUserConfigPath ? : $defaultUserConfigPath;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will throw an error on line 116 if both $customUserconfigPath and $defaultUserConfigPath contain a non-existing path; at the very least should a is_readable check be added to the if-statement below (in addition to the null check)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've added the is_readable in a new commit.
Thank you for the comment, I do not think this test missed 👍

…d file

If $defaultUserConfigPath and $customUserConfigPath are null or contain invalid path we should not try to load it...

Signed-off-by: Stéphane HULARD <s.hulard@chstudio.fr>
@mvriel
Copy link
Member

mvriel commented Aug 1, 2014

Thanks for adding that! You might be right but it never hurts to be a little defensive (that check should have been there in the original version as well). I have merged this item

mvriel added a commit that referenced this pull request Aug 1, 2014
@mvriel mvriel merged commit 9eb706e into phpDocumentor:develop Aug 1, 2014
@shulard
Copy link
Contributor Author

shulard commented Aug 1, 2014

Thanks, don't worry I'm not hurted, maybe my english is not so good to use the right words...
I'm happy to helped building this awesome tool!

@shulard shulard deleted the feature/config-dist-loading branch August 1, 2014 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants