Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/contentsource/PhabricatorContentSource.php
| Show All 40 Lines | public static function newFromSerialized($serialized) { | ||||
| $obj->source = idx($dict, 'source', self::SOURCE_UNKNOWN); | $obj->source = idx($dict, 'source', self::SOURCE_UNKNOWN); | ||||
| $obj->params = idx($dict, 'params', array()); | $obj->params = idx($dict, 'params', array()); | ||||
| return $obj; | return $obj; | ||||
| } | } | ||||
| public static function newConsoleSource() { | public static function newConsoleSource() { | ||||
| return self::newForSource( | return self::newForSource( | ||||
| PhabricatorContentSource::SOURCE_CONSOLE, | self::SOURCE_CONSOLE, | ||||
| array()); | array()); | ||||
| } | } | ||||
| public static function newFromRequest(AphrontRequest $request) { | public static function newFromRequest(AphrontRequest $request) { | ||||
| return self::newForSource( | return self::newForSource( | ||||
| PhabricatorContentSource::SOURCE_WEB, | self::SOURCE_WEB, | ||||
| array( | array( | ||||
| 'ip' => $request->getRemoteAddr(), | 'ip' => $request->getRemoteAddr(), | ||||
| )); | )); | ||||
| } | } | ||||
| public static function newFromConduitRequest(ConduitAPIRequest $request) { | public static function newFromConduitRequest(ConduitAPIRequest $request) { | ||||
| return self::newForSource( | return self::newForSource( | ||||
| PhabricatorContentSource::SOURCE_CONDUIT, | self::SOURCE_CONDUIT, | ||||
| array()); | array()); | ||||
| } | } | ||||
| public static function getSourceNameMap() { | public static function getSourceNameMap() { | ||||
| return array( | return array( | ||||
| self::SOURCE_WEB => pht('Web'), | self::SOURCE_WEB => pht('Web'), | ||||
| self::SOURCE_EMAIL => pht('Email'), | self::SOURCE_EMAIL => pht('Email'), | ||||
| self::SOURCE_CONDUIT => pht('Conduit'), | self::SOURCE_CONDUIT => pht('Conduit'), | ||||
| Show All 33 Lines | |||||