Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/site/PhameBlogSite.php
| Show All 18 Lines | final class PhameBlogSite extends PhameSite { | ||||
| public function shouldRequireHTTPS() { | public function shouldRequireHTTPS() { | ||||
| // TODO: We should probably provide options here eventually, but for now | // TODO: We should probably provide options here eventually, but for now | ||||
| // just never require HTTPS for external-domain blogs. | // just never require HTTPS for external-domain blogs. | ||||
| return false; | return false; | ||||
| } | } | ||||
| public function getPriority() { | public function getPriority() { | ||||
| return 4000; | return 3000; | ||||
| } | } | ||||
| public function newSiteForRequest(AphrontRequest $request) { | public function newSiteForRequest(AphrontRequest $request) { | ||||
| if (!$this->isPhameActive()) { | if (!$this->isPhameActive()) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| $host = $request->getHost(); | $host = $request->getHost(); | ||||
| Show All 12 Lines | public function newSiteForRequest(AphrontRequest $request) { | ||||
| if (!$blog) { | if (!$blog) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| return id(new PhameBlogSite())->setBlog($blog); | return id(new PhameBlogSite())->setBlog($blog); | ||||
| } | } | ||||
| public function getPathForRouting(AphrontRequest $request) { | public function getRoutingMaps() { | ||||
| $path = $request->getPath(); | $app = PhabricatorApplication::getByClass('PhabricatorPhameApplication'); | ||||
| $id = $this->getBlog()->getID(); | |||||
| return "/phame/live/{$id}/{$path}"; | $maps = array(); | ||||
| $maps[] = $this->newRoutingMap() | |||||
| ->setApplication($app) | |||||
| ->setRoutes($app->getBlogRoutes()); | |||||
| return $maps; | |||||
| } | } | ||||
| } | } | ||||