1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Make drydock case sensitive in attribute parsing

Summary: See D4047. Get rid of this strtolower() junk.

Test Plan:
```
$ /bin/drydock lease --type working-copy --attributes repositoryID=12
Acquired Lease 66
```

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2015

Differential Revision: https://secure.phabricator.com/D4048
This commit is contained in:
epriestley 2012-11-29 06:05:35 -08:00
parent 9c76964aa7
commit 150f711cc8
4 changed files with 7 additions and 4 deletions

View file

@ -34,6 +34,7 @@ final class DrydockManagementLeaseWorkflow
$attributes = $args->getArg('attributes');
if ($attributes) {
$options = new PhutilSimpleOptions();
$options->setCaseSensitive(true);
$attributes = $options->parse($attributes);
}

View file

@ -26,12 +26,12 @@ final class DrydockLease extends DrydockDAO {
}
public function setAttribute($key, $value) {
$this->attributes[strtolower($key)] = $value;
$this->attributes[$key] = $value;
return $this;
}
public function getAttribute($key, $default = null) {
return idx($this->attributes, strtolower($key), $default);
return idx($this->attributes, $key, $default);
}
public function generatePHID() {

View file

@ -15,7 +15,8 @@ final class CelerityResourceTransformerTestCase extends PhabricatorTestCase {
list($options, $in, $expect) = $parts;
$options = PhutilSimpleOptions::parse($options) + array(
$parser = new PhutilSimpleOptions();
$options = $parser->parse($options) + array(
'minify' => false,
'name' => $name,
);

View file

@ -43,7 +43,8 @@ final class PhabricatorRemarkupRuleEmbedFile
if (!empty($matches[2])) {
$matches[2] = trim($matches[2], ', ');
$options = PhutilSimpleOptions::parse($matches[2]) + $options;
$parser = new PhutilSimpleOptions();
$options = $parser->parse($matches[2]) + $options;
}
$file_name = coalesce($options['name'], $file->getName());
$options['name'] = $file_name;