mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 09:58:24 +01:00
No description
f7e8fa0764
Summary: Depends on D20040. Ref T13242. See PHI1039. See PHI873. Two reasonable cases have arisen recently where extending validation rules would help solve problems. We can do this in a pretty straightforward way with a standard extension pattern. Test Plan: Used this extension to keep ducks away from projects: ```lang=php <?php final class NoDucksEditorExtension extends PhabricatorEditorExtension { const EXTENSIONKEY = 'no.ducks'; public function getExtensionName() { return pht('No Ducks!'); } public function supportsObject( PhabricatorApplicationTransactionEditor $editor, PhabricatorApplicationTransactionInterface $object) { return ($object instanceof PhabricatorProject); } public function validateTransactions($object, array $xactions) { $errors = array(); $name_type = PhabricatorProjectNameTransaction::TRANSACTIONTYPE; $old_value = $object->getName(); foreach ($xactions as $xaction) { if ($xaction->getTransactionType() !== $name_type) { continue; } $new_value = $xaction->getNewValue(); if ($old_value === $new_value) { continue; } if (preg_match('/duck/i', $new_value)) { $errors[] = $this->newInvalidTransactionError( $xaction, pht('Project names must not contain the substring "duck".')); } } return $errors; } } ``` {F6162585} Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13242 Differential Revision: https://secure.phabricator.com/D20041 |
||
---|---|---|
bin | ||
conf | ||
externals | ||
resources | ||
scripts | ||
src | ||
support | ||
webroot | ||
.arcconfig | ||
.arclint | ||
.arcunit | ||
.editorconfig | ||
.gitignore | ||
LICENSE | ||
NOTICE | ||
README.md |
Phabricator is a collection of web applications which help software companies build better software.
Phabricator includes applications for:
- reviewing and auditing source code;
- hosting and browsing repositories;
- tracking bugs;
- managing projects;
- conversing with team members;
- assembling a party to venture forth;
- writing stuff down and reading it later;
- hiding stuff from coworkers; and
- also some other things.
You can learn more about the project (and find links to documentation and resources) at Phabricator.org
Phabricator is developed and maintained by Phacility.
SUPPORT RESOURCES
For resources on filing bugs, requesting features, reporting security issues, and getting other kinds of support, see Support Resources.
NO PULL REQUESTS!
We do not accept pull requests through GitHub. If you would like to contribute code, please read our Contributor's Guide.
LICENSE
Phabricator is released under the Apache 2.0 license except as otherwise noted.