Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Fixed creating module with namespace #69

Merged
merged 1 commit into from
Mar 13, 2018
Merged

Fixed creating module with namespace #69

merged 1 commit into from
Mar 13, 2018

Conversation

michalbundyra
Copy link
Member

Proper directory structure is created for modules with namespace
eg. 'MyNamespace\MyModule'

Proper directory structure is created for modules with namespace
eg. 'MyNamespace\MyModule'
@michalbundyra
Copy link
Member Author

I have another though about this issue and maybe we should allow only alphanumeric characters in module name. Allowing namespace separator causes issues and requires changes also in zf-composer -autoloading. Maybe we should rather add option --namespace as suggested in #66.

@weierophinney what do you think?

@@ -94,7 +99,7 @@ private function createDirectoryStructure(string $modulePath, string $moduleName
));
}

if (! mkdir($modulePath)) {
if (! mkdir($modulePath, 0777, true)) {
Copy link

@hkulekci hkulekci Mar 13, 2018

Choose a reason for hiding this comment

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

Will this (0777) be a security issue? I think, we should throw an exception only about file permission?

Copy link
Member

Choose a reason for hiding this comment

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

@hkulekci These are the default permissions when calling mkdir(); they're used here simply because we're also passing the third argument, the flag to recursively create the path.

@weierophinney
Copy link
Member

@webimpress While I think that idea can be useful, we can address it with a later patch.

This one looks good, though!

@weierophinney weierophinney merged commit 34eabc1 into zendframework:release-1.0.0 Mar 13, 2018
weierophinney added a commit that referenced this pull request Mar 13, 2018
weierophinney added a commit that referenced this pull request Mar 13, 2018
In new 1.0.0rc1 section.
@weierophinney
Copy link
Member

Thanks, @webimpress

@michalbundyra michalbundyra mentioned this pull request Mar 13, 2018
@michalbundyra michalbundyra deleted the hotfix/module-with-namespace branch November 21, 2019 09:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants