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

[2.1] Added the support of Apache's passwords #3243

Merged
merged 2 commits into from
Jan 4, 2013

Conversation

ezimuel
Copy link
Contributor

@ezimuel ezimuel commented Dec 18, 2012

Added the support of Apache's passwords in Zend\Crypt\Password\Apache.
I implemented the different password formats supported by htpasswd, reported here:
http://httpd.apache.org/docs/2.2/misc/password_encryptions.html

break;
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this can be cleaned up a bit. I'd do the following:

if (empty($options)) {
    return;
}
if (!is_array($options) && !$options instanceof Traversable) {
    throw new Exception\InvalidArgumentException(/* must be array or traversable */);
}
foreach ($options as $key => $value) {
    // set options as above
}

This way, the bulk of the work is not in a conditional, and you're not needing to cast Traversables to an array (as you're simply iterating over them).

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

@ghost ghost assigned weierophinney Jan 3, 2013
@weierophinney
Copy link
Member

Looks good, @ezimuel -- make the changes as suggested, and I can merge.

weierophinney added a commit that referenced this pull request Jan 4, 2013
- trailing whitespace
- add comma after last array element
@weierophinney weierophinney merged commit 77a77b1 into zendframework:develop Jan 4, 2013
weierophinney added a commit to zendframework/zend-crypt that referenced this pull request May 15, 2015
- trailing whitespace
- add comma after last array element
weierophinney added a commit to zendframework/zend-crypt that referenced this pull request May 15, 2015
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.

2 participants