From bd47d001b5482d8f8160a011ac8a0dd76f147e13 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Wed, 9 Aug 2017 22:49:25 +0000 Subject: [PATCH 1/2] Remove chatbot example configuration Summary: This is no longer needed after the chatbot was removed in D17756. Test Plan: N/A Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D18378 --- resources/chatbot/example_config.json | 24 ------------------- .../files/storage/PhabricatorFile.php | 8 +++++-- 2 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 resources/chatbot/example_config.json diff --git a/resources/chatbot/example_config.json b/resources/chatbot/example_config.json deleted file mode 100644 index 7d150e65ae..0000000000 --- a/resources/chatbot/example_config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "server" : "irc.freenode.net", - "port" : 6667, - "nick" : "phabot", - "join" : [ - "#phabot-test" - ], - "handlers" : [ - "PhabricatorBotObjectNameHandler", - "PhabricatorBotSymbolHandler", - "PhabricatorBotLogHandler", - "PhabricatorBotFeedNotificationHandler", - "PhabricatorBotWhatsNewHandler", - "PhabricatorBotMacroHandler" - ], - - "conduit.uri" : null, - "conduit.token" : null, - - "macro.size" : 48, - "macro.aspect" : 0.66, - - "notification.channels" : ["#phabot-test"] -} diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index 19f0bed90a..97c2ef6acc 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -854,7 +854,7 @@ final class PhabricatorFile extends PhabricatorFileDAO return $this->getTransformedURI($transform->getTransformKey()); } - private function getTransformedURI($transform) { + private function getTransformedURI($transform, $cdn) { $parts = array(); $parts[] = 'file'; $parts[] = 'xform'; @@ -871,7 +871,11 @@ final class PhabricatorFile extends PhabricatorFileDAO $path = implode('/', $parts); $path = $path.'/'; - return PhabricatorEnv::getCDNURI($path); + if ($cdn) { + return PhabricatorEnv::getCDNURI($path); + } else { + return PhabricatorEnv::getURI($path); + } } public function isViewableInBrowser() { From 71eaf3e8c4d61203ab2887ab1a294ea81bd6ae83 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Thu, 10 Aug 2017 08:59:52 +1000 Subject: [PATCH 2/2] Remove code that was accidentally landed Summary: See some discussion in D18378. Test Plan: N/A Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D18380 --- src/applications/files/storage/PhabricatorFile.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index 97c2ef6acc..19f0bed90a 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -854,7 +854,7 @@ final class PhabricatorFile extends PhabricatorFileDAO return $this->getTransformedURI($transform->getTransformKey()); } - private function getTransformedURI($transform, $cdn) { + private function getTransformedURI($transform) { $parts = array(); $parts[] = 'file'; $parts[] = 'xform'; @@ -871,11 +871,7 @@ final class PhabricatorFile extends PhabricatorFileDAO $path = implode('/', $parts); $path = $path.'/'; - if ($cdn) { - return PhabricatorEnv::getCDNURI($path); - } else { - return PhabricatorEnv::getURI($path); - } + return PhabricatorEnv::getCDNURI($path); } public function isViewableInBrowser() {