Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14357469
D14103.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D14103.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2694,7 +2694,6 @@
'PhabricatorRemarkupCustomBlockRule' => 'infrastructure/markup/rule/PhabricatorRemarkupCustomBlockRule.php',
'PhabricatorRemarkupCustomInlineRule' => 'infrastructure/markup/rule/PhabricatorRemarkupCustomInlineRule.php',
'PhabricatorRemarkupFigletBlockInterpreter' => 'infrastructure/markup/interpreter/PhabricatorRemarkupFigletBlockInterpreter.php',
- 'PhabricatorRemarkupGraphvizBlockInterpreter' => 'infrastructure/markup/interpreter/PhabricatorRemarkupGraphvizBlockInterpreter.php',
'PhabricatorRemarkupUIExample' => 'applications/uiexample/examples/PhabricatorRemarkupUIExample.php',
'PhabricatorRepositoriesSetupCheck' => 'applications/config/check/PhabricatorRepositoriesSetupCheck.php',
'PhabricatorRepository' => 'applications/repository/storage/PhabricatorRepository.php',
@@ -6749,7 +6748,6 @@
'PhabricatorRemarkupCustomBlockRule' => 'PhutilRemarkupBlockRule',
'PhabricatorRemarkupCustomInlineRule' => 'PhutilRemarkupRule',
'PhabricatorRemarkupFigletBlockInterpreter' => 'PhutilRemarkupBlockInterpreter',
- 'PhabricatorRemarkupGraphvizBlockInterpreter' => 'PhutilRemarkupBlockInterpreter',
'PhabricatorRemarkupUIExample' => 'PhabricatorUIExample',
'PhabricatorRepositoriesSetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorRepository' => array(
diff --git a/src/infrastructure/markup/interpreter/PhabricatorRemarkupGraphvizBlockInterpreter.php b/src/infrastructure/markup/interpreter/PhabricatorRemarkupGraphvizBlockInterpreter.php
deleted file mode 100644
--- a/src/infrastructure/markup/interpreter/PhabricatorRemarkupGraphvizBlockInterpreter.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-final class PhabricatorRemarkupGraphvizBlockInterpreter
- extends PhutilRemarkupBlockInterpreter {
-
- public function getInterpreterName() {
- return 'dot';
- }
-
- public function markupContent($content, array $argv) {
- if (!Filesystem::binaryExists('dot')) {
- return $this->markupError(
- pht(
- 'Unable to locate the `%s` binary. Install Graphviz.',
- 'dot'));
- }
-
- $width = $this->parseDimension(idx($argv, 'width'));
-
- $future = id(new ExecFuture('dot -T%s', 'png'))
- ->setTimeout(15)
- ->write(trim($content));
-
- list($err, $stdout, $stderr) = $future->resolve();
-
- if ($err) {
- return $this->markupError(
- pht(
- 'Execution of `%s` failed (#%d), check your syntax: %s',
- 'dot',
- $err,
- $stderr));
- }
-
- $file = PhabricatorFile::buildFromFileDataOrHash(
- $stdout,
- array(
- 'name' => 'graphviz.png',
- ));
-
- if ($this->getEngine()->isTextMode()) {
- return '<'.$file->getBestURI().'>';
- }
-
- $img = phutil_tag(
- 'img',
- array(
- 'src' => $file->getBestURI(),
- 'width' => nonempty($width, null),
- ));
- return phutil_tag_div('phabricator-remarkup-embed-image-full', $img);
- }
-
- // TODO: This is duplicated from PhabricatorEmbedFileRemarkupRule since they
- // do not share a base class.
- private function parseDimension($string) {
- $string = trim($string);
-
- if (preg_match('/^(?:\d*\\.)?\d+%?$/', $string)) {
- return $string;
- }
-
- return null;
- }
-}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 5:15 AM (17 h, 34 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6912841
Default Alt Text
D14103.diff (3 KB)
Attached To
Mode
D14103: Remove dot/Graphviz Remarkup rule
Attached
Detach File
Event Timeline
Log In to Comment